Handling Exceptions

SSOLite stored procedures signal a SQL state and set the error text accordingly if any procedure fails. Note that:

The error text is always preceded by the string (SWERROR).
Each error has a unique ID, which is displayed at the end of the error text.

For example,

SIGNAL SQLSTATE '38200' SET MESSAGE_TEXT = 'SW_GRAFTCOUNT:(SWERROR) Failed to get node ID (ID:001024)';

It is the application’s responsibility to handle any such database exceptions, and issue a rollback if appropriate.

The following table describes the different errors (and their unique IDs) that may be returned by the SSOLite stored procedures.

Note: Some of the stored procedures listed in the table are not described in this section. These are lower level stored procedures that may be called by some or all of the stored procedures that are described in this section.

Stored Procedure

SQLSTATE Value

Error Text

SW_GET_NODE_DETAILS

38200

MBox Queue Name(s) not found in database (ID:001008)

SW_GET_PROCEDURE

38200

Procedure details not found in database for procedure name=proc_name (ID:001010)

38200

Procedure version not found in database for procedure name=proc_name, Case Num=case_num (ID:001011)

38200

Latest Released or Unreleased Procedure version not found in database for procedure name=proc_name (ID:001012)

38200

Procedure version not found in database for procedure name=proc_name major_version minor_version (ID:001013)

SW_SUSPEND

38200

Suspend type (suspend_type) is invalid, expected 2 (suspend) or 0 (activate) (ID:001014)

38200

Failed to get node ID (ID:001015)

38200

Failed to get procedure ID (ID:001016)

38200

Failed to get request ID (ID:001017)

38200

Case (case_num) is already active (ID:001036)

38200

Case (case_num) is dead (ID:001037)

38200

Case (case_num) is already suspended (ID:001038)

38200

Procedure and case information does not match (ID:001043)

SW_GETCASE_STATUS_EX

38200

Failed to find case information for case: case_num (ID:001019)

SW_DELAYED_RELEASE

38200

Failed to get node ID (ID:001022)

38200

Failed to get procedure ID (ID:001023)

SW_DELAYED_RELEASE_ERR

38200

Failed to get node ID (ID:001022)

SW_GRAFTCOUNT

 

38200

Failed to get node ID (ID:001024)

38200

Failed to get procedure ID (ID:001025)

38200

Failed to get request ID (ID:001026)

SW_DELAYED_RELEASE_ERR

38200

Failed to get node ID (ID:001027)

38200

Failed to get procedure ID (ID:001028)

38200

Failed to get request ID (ID:001029)

SW_PURGE

38200

Failed to get node ID (ID:001030)

38200

Failed to get procedure ID (ID:001031)

38200

Failed to get request ID (ID:001032)

38200

Procedure and case information does not match (ID:001041)

38200

Failed to get node ID (ID:001033)

38200

Failed to get procedure ID (ID:001034)

38200

Failed to get request ID (ID:001035)

38200

Case (case_num) is dead (ID:001039)

38200

Procedure and case information does not match (ID:001042)