public String getMessage ( ) { if ( code == NO_DATA ) return "A document cannot be added without resource data." ; else if ( code == NO_LOCATOR ) return "A document cannot be added without a resource locator." ; else if ( code == INVALID_JSON ) return "The provided JSON could not be compiled. Check that the JSON provided is valid." ; else if ( code == NOT_CONFIGURED ) return "The exporter must be configured before this action can be taken." ; else if ( code == BENCODE_FAILED ) return "The document could not be bencoded. The resource data may be an invalid structure." ; else if ( code == SIGNING_FAILED ) return "The document could not be digitally signed. Check that the private key data is correct." ; else if ( code == NO_KEY ) return "No private key could be found in the provided private key data." ; else if ( code == NO_KEY_STREAM ) return "The private key data could not be accessed. Check that a valid local file or valid private key dump is provided." ; else if ( code == NULL_FIELD ) return "A required field was not provided with valid input." ; else if ( code == BATCH_ZERO ) return "Batch size must be larger than zero." ; else if ( code == NO_DOCUMENTS ) return "At least one document must be included in order to send data." ; else if ( code == NO_RESPONSE ) return "The Learning Registry node did not return a response to the request." ; else if ( code == INVALID_RESPONSE ) return "The response from the Learning Registry node did not match the form of an expected response." ; else if ( code == JSON_FAILED ) return "The batch of documents could not be converted to a JSON string. Check that no invalid characters were included in the data of any document." ; else if ( code == JSON_IMPORT_FAILED ) return "The batch of documents could not be converted to a JSON string. Check that the node did not return an error or invalid JSON." ; else if ( code == IMPORT_FAILED ) return "Capturing data from the node failed. Please check that the node is running and returning results properly." ; else if ( code == INPUT_STREAM_FAILED ) return "The provided inputs could not be converted into input streams." ; else if ( code == SIGNATURE_NOT_FOUND ) return "A signature matching the provided key could not be found." ; else if ( code == SIGNATURE_INVALID ) return "The signature stream does not contain a valid signature." ; else if ( code == MESSAGE_INVALID ) return "The message stream could not be parsed." ; else if ( code == INVALID_PUBLIC_KEY ) return "The public key stream does not contain a valid public key." ; else return "An unknown error has ocurred." ; }
Get the message attached to the exception