swimlane.exceptions module

Custom exceptions and errors

exception swimlane.exceptions.InvalidServerVersion(swimlane, min_version, max_version)[source]

Bases: swimlane.exceptions.SwimlaneException, exceptions.NotImplementedError

Raised when method requiring a specific server version range is called when connected to server outside range

swimlane

Swimlane – Swimlane client failing the version check

min_version

str – Minimum version specified on version range

max_version

str – Maximum version specified on version range

exception swimlane.exceptions.SwimlaneException[source]

Bases: exceptions.Exception

Base exception for Swimlane errors

exception swimlane.exceptions.SwimlaneHTTP400Error(http_error)[source]

Bases: swimlane.exceptions.SwimlaneException, requests.exceptions.HTTPError

Exception raised when receiving a 400 response with additional context

code

int – Swimlane error code

name

str – Human-readable Swimlane error name

argument

str – Optional argument included with error or None

http_error

HTTPError – Source requests.HTTPError caught and used to generate this exception

codes = {5008: 'ModelValidationError', 5010: 'RequiredFieldMissing', 5000: 'AppLimitExceeded', 5001: 'UserLimitExceeded', 5002: 'NewServerInstall', 5003: 'UnableToConnectToActiveDirectory', 5004: 'UnableToRetrieveStoredValue', 5005: 'UnableToConnectToMongoDb', 5006: 'UnableToConnectToSmtp', 5007: 'SwimlaneAlreadyInitialized', 2000: 'DuplicateFieldName', 2001: 'FieldNameEmpty', 2002: 'InvalidApplicationExportFile', 2003: 'ApplicationNotFound', 2004: 'InvalidCalculation', 7000: 'RegexNotDefined', 7001: 'AssetNotFound', 1051: 'DuplicateGroupName', 10000: 'DuplicateTaskName', 4000: 'BadStatsGroup', 4001: 'BadFilter', 1061: 'DuplicateRoleName', 5009: 'UpgradeInProcess', 1000: 'PasswordExpired', 1001: 'DuplicateUserName', 1002: 'InvalidUserNameOrPassword', 1003: 'ConfirmPasswordDoesNotMatch', 1004: 'PasswordDoesNotMeetComplexityRequirements', 1005: 'PasswordResetRequired', 1006: 'NewPasswordCannotMatchCurrent', 1007: 'InvalidUser', 6000: 'ConnectionDataNotProvided', 9000: 'BadThreatIntelConnector', 9001: 'NoThreatIntel', 3000: 'DuplicateFieldValue', 3001: 'InvalidDateField', 3002: 'RecordNotFound', 3003: 'FieldNotFound', 10001: 'TaskNotFound', 9002: 'ThreatIntelTypeNotSupportedByThisProvider', -1: 'Unknown'}
exception swimlane.exceptions.UnknownField(app, field_name, field_pool)[source]

Bases: swimlane.exceptions.SwimlaneException, exceptions.KeyError

Raised anytime access is attempted to a field that does not exist on an App or Record

app

App – App with the unknown field requested

field_name

str – Name of the field that was requested

similar_field_names

list(str) – List of strings of fields on app that are potentially similar to field_name

exception swimlane.exceptions.ValidationError(record, failure)[source]

Bases: swimlane.exceptions.SwimlaneException, exceptions.ValueError

Raised when record’s field data is invalid

record

Record – Record in context of validation failure

failure

str – Reason for record failure