new ServerError()
- Deprecated:
-
- You should never need to construct one of these directly they will be provided to callbacks for REST API operations as the first argument if they occur.
- Source:
- See:
-
The flashheart documentation for more info on possible Error contents.
Example
const ServerError = require('classeur-api-client').ServerError myClient.getFile('nonexistent', (error) => { if ( error instanceof ServerError ) { console.log(error.message) // e.g. 'Server error: Received HTTP code 403 for GET https:// ...' console.log(error.reason) // e.g. 'file_is_not_readable' console.log(error.status) // e.g. 403 throw error } })
Extends
Members
-
<readonly> headers :Object
-
If headers were returned from the server with the error, this object will contain their contents. It is supplied directly by the flashheart REST client library.
Type:
- Object
- Source:
- See:
-
The flashheart documentation for more information about this field's contents.
-
<readonly> status :Number
-
HTTP status code of the error.
Type:
- Number
- Source: