DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
{column:width=80px|padding=0px}{column}{column}{column}
Constants Summary
ABSTRACT_FORM
Exception code for ABSTRACT_FORM.
ACQUIRE_LOCK_FAILURE
Exception code for ACQUIRE_LOCK_FAILURE.
BAD_SQL_SYNTAX
Exception code for BAD_SQL_SYNTAX.
CLIENT_NOT_AUTHORIZED
Exception code for CLIENT_NOT_AUTHORIZED.
DATA_ACCESS_RESOURCE_FAILURE
Exception code for DATA_ACCESS_RESOURCE_FAILURE.
DATA_INTEGRITY_VIOLATION
Exception code for DATA_INTEGRITY_VIOLATION.
DELETE_NOT_GRANTED
Exception code for DELETE_NOT_GRANTED.
EXECUTE_PROGRAM_FAILED
Exception code for EXECUTE_PROGRAM_FAILED.
INCORRECT_LOGIN
Exception code for INCORRECT_LOGIN.
INVALID_INPUT
Exception code for INVALID_INPUT.
INVALID_RESULTSET_ACCESS
Exception code for INVALID_RESULTSET_ACCESS.
MAINTENANCE_MODE
Exception code for MAINTENANCE_MODE.
NO_CREATE_ACCESS
Exception code for NO_CREATE_ACCESS.
NO_DELETE_ACCESS
Exception code for NO_DELETE_ACCESS.
NO_LICENSE
Exception code for NO_LICENSE.
NO_MODIFY_ACCESS
Exception code for NO_MODIFY_ACCESS.
NO_PARENT_DELETE_WITH_RELATED_RECORDS
Exception code for NO_PARENT_DELETE_WITH_RELATED_RECORDS.
NO_RELATED_CREATE_ACCESS
Exception code for NO_RELATED_CREATE_ACCESS.
PERMISSION_DENIED
Exception code for PERMISSION_DENIED.
RECORD_LOCKED
Exception code for RECORD_LOCKED.
RECORD_VALIDATION_FAILED
Exception code for RECORD_VALIDATION_FAILED.
SAVE_FAILED
Exception code for SAVE_FAILED.
UNEXPECTED_UPDATE_COUNT
Exception code for UNEXPECTED_UPDATE_COUNT.
UNKNOWN_DATABASE_EXCEPTION
Exception code for UNKNOWN_DATABASE_EXCEPTION.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
getErrorCode()
Returns the error code for this ServoyException.
getMessage()
Returns the string message for this ServoyException.
Object[]
getParameters()
Returns the parameters of the SQL query that caused this DataException in an array.
getSQLState()
Returns the SQLState for this DataException.
getScriptStackTrace()
Returns the script stack trace for this ServoyException if this could be created.
getStackTrace()
Returns the stack trace for this ServoyException.
getVendorErrorCode()
Returns the error code of the error thrown by the back-end database server.
{column:width=100%|padding=0px}{column}
Constants Details
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
{column:width=100%|padding=0px}{column}
Method Details
getErrorCode
()
Returns
Number – the error code for this ServoyException. Can be one of the constants declared in ServoyException.
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
getMessage
()
Returns
String – the string message for this ServoyException.
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
Object[]
getParameters
()
Returns
Object[] – the parameters of the SQL query that caused this DataException in an array.
Sample
var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { var param = record.exception.getParameters(); for (j = 0; j < param.length; j++) { application.output("SQL Parameter [" + j + "]: " + param[j]); } }
getSQL
()
Returns
String – the SQL query that caused this DataException.
Sample
var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { application.output("SQL: " + record.exception.getSQL()); }
getSQLState
()
Sample
var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { application.output("SQLState: " + record.exception.getSQLState()); }
getScriptStackTrace
()
Returns
String – the string stack trace for this ServoyException.
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
getStackTrace
()
Returns
String – the string stack trace for this ServoyException.
Sample
//this sample script should be attached to onError method handler in the solution settings application.output('Exception Object: '+ex) application.output('MSG: '+ex.getMessage()) if (ex instanceof ServoyException) { /** @type {ServoyException} */ var servoyException = ex; application.output("is a ServoyException") application.output("Errorcode: "+servoyException.getErrorCode()) var trace = ""; if (ex.getScriptStackTrace) trace = servoyException.getScriptStackTrace(); else if (servoyException.getStackTrace) trace = servoyException.getStackTrace(); if (servoyException.getErrorCode() == ServoyException.SAVE_FAILED) { plugins.dialogs.showErrorDialog( 'Error', 'It seems you did not fill in a required field', 'OK'); //Get the failed records after a save var array = databaseManager.getFailedRecords() for( var i = 0 ; i < array.length ; i++ ) { var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { /** @type {DataException} */ var dataException = record.exception; application.output('SQL: '+dataException.getSQL()) application.output('SQLState: '+dataException.getSQLState()) application.output('VendorErrorCode: '+dataException.getVendorErrorCode()) } } return false } } //if returns false or no return, error is not reported to client; if returns true error is reported //by default error report means logging the error, in smart client an error dialog will also show up return true
getValue
()
Sample
var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { application.output("VALUE: " + record.exception.getValue()); }
getVendorErrorCode
()
Returns
Number – the error code of the error thrown by the back-end database server.
Sample
var record = array[i]; application.output(record.exception); if (record.exception instanceof DataException) { application.output("VendorErrorCode: " + record.exception.getVendorErrorCode()); }