new ClientError()
- 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 restler documentation for more info on possible Error contents.
Example
const ClientError = require('classeur-api-client').ClientError; myClient.getFile('nonexistent', (error) => { if ( error instanceof ClientError ) { console.log(error.message); // e.g. 'JSON decoding failed!' throw error; } });
Extends
Members
-
<readonly> request :Request
The HTTP request object that caused the error.
-
A request object as returned by the
get
method of restler.Type:
- Request
- Deprecated:
-
- This is usually not useful.
- Source:
- See:
-
The restler source for the Request constructor.
-
<readonly, nullable> timeout :Number
-
If a timeout occurred, this property will be set to the timeout threshold that was exceeded (in milliseconds). This property will only be set if a ClientError occurred due to a timeout.
Type:
- Number
- Source:
- See:
-
The restler source for the Request constructor.