resin-errors v2.13.0
resin-errors
Resin.io error collection
(https://badges.gitter.im/Join Chat.svg)
Role
The intention of this module is to provide a collection of Error instances to be used by the Resin SDK.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Unless you know what you're doing, use the Resin SDK instead.
Installation
Install resin-errors by running:
$ npm install --save resin-errorsDocumentation
- errors
- ~ResinInvalidDeviceType
- ~ResinDiscontinuedDeviceType
- ~ResinMalformedToken
- ~ResinSupervisorLockedError
- ~ResinExpiredToken
- ~ResinApplicationNotFound
~ResinBuildNotFound- ~ResinReleaseNotFound
- ~ResinImageNotFound
- ~ResinServiceNotFound
- ~ResinDeviceNotFound
- ~ResinAmbiguousDevice
- ~ResinAmbiguousApplication
- ~ResinKeyNotFound
- ~ResinRequestError
- ~ResinNotLoggedIn
- ~ResinInvalidParameterError
errors~ResinInvalidDeviceType
Kind: inner class of errors
Summary: Resin invalid device type
Access: public
new ResinInvalidDeviceType(type)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| type | String | device type |
Example
throw new errors.ResinInvalidDeviceType('raspberry-pi')errors~ResinDiscontinuedDeviceType
Kind: inner class of errors
Summary: Resin discontinued device type
Access: public
new ResinDiscontinuedDeviceType(type)
The device type that you specified is invalid because it is discontinued, and this operation is no longer supported.
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| type | String | device type |
Example
throw new errors.ResinDiscontinuedDeviceType('edge')errors~ResinMalformedToken
Kind: inner class of errors
Summary: Resin malformed token
Access: public
new ResinMalformedToken(token)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| token | String | token |
Example
throw new errors.ResinMalformedToken('1234')errors~ResinSupervisorLockedError
Kind: inner class of errors
Summary: The device supervisor is locked
Access: public
new ResinSupervisorLockedError(token)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| token | String | token |
Example
throw new errors.ResinSupervisorLockedError()errors~ResinExpiredToken
Kind: inner class of errors
Summary: Resin expired token
Access: public
new ResinExpiredToken(token)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| token | String | token |
Example
throw new errors.ResinExpiredToken('1234')errors~ResinApplicationNotFound
Kind: inner class of errors
Summary: Resin application not found
Access: public
new ResinApplicationNotFound(application)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| application | String | Number | application name or id |
Example
throw new errors.ResinApplicationNotFound('MyApp')errors~ResinBuildNotFound
Deprecated
Kind: inner class of errors
Summary: Resin build not found
Access: public
new ResinBuildNotFound(build)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| build | Number | build id |
Example
throw new errors.ResinBuildNotFound(123)errors~ResinReleaseNotFound
Kind: inner class of errors
Summary: Resin release not found
Access: public
new ResinReleaseNotFound(release)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| release | Number | release id |
Example
throw new errors.ResinReleaseNotFound(123)errors~ResinImageNotFound
Kind: inner class of errors
Summary: Resin image not found
Access: public
new ResinImageNotFound(image)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| image | Number | image id |
Example
throw new errors.ResinImageNotFound(123)errors~ResinServiceNotFound
Kind: inner class of errors
Summary: Resin service not found
Access: public
new ResinServiceNotFound(service)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| service | Number | service id |
Example
throw new errors.ResinServiceNotFound(123)errors~ResinDeviceNotFound
Kind: inner class of errors
Summary: Resin device not found
Access: public
new ResinDeviceNotFound(device)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| device | String | Number | device name or id |
Example
throw new errors.ResinDeviceNotFound('MyDevice')errors~ResinAmbiguousDevice
Kind: inner class of errors
Summary: Resin ambiguous device
Access: public
new ResinAmbiguousDevice(device)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| device | String | Number | device name or id |
Example
throw new errors.ResinAmbiguousDevice('MyDevice')errors~ResinAmbiguousApplication
Kind: inner class of errors
Summary: Resin ambiguous application
Access: public
new ResinAmbiguousApplication(application)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| application | String | Number | application name or id |
Example
throw new errors.ResinAmbiguousApplication('MyApp')errors~ResinKeyNotFound
Kind: inner class of errors
Summary: Resin key not found
Access: public
new ResinKeyNotFound(key)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| key | String | Number | key name, id or value |
Example
throw new errors.ResinKeyNotFound('MyKey')errors~ResinRequestError
Kind: inner class of errors
Summary: Resin request error
Access: public
new ResinRequestError(body, statusCode, requestOptions)
Returns: Error - error instance
| Param | Type | Description |
|---|---|---|
| body | String | response body |
| statusCode | Number | http status code |
| requestOptions | Object | options used to make the request |
Example
throw new errors.ResinRequestError('Unauthorized')errors~ResinNotLoggedIn
Kind: inner class of errors
Summary: Resin not logged in
Access: public
errors~ResinInvalidParameterError
Kind: inner class of errors
Summary: Resin invalid parameter
Access: public
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Tests
Run the test suite by doing:
$ gulp testContribute
- Issue Tracker: github.com/resin-io-modules/resin-errors/issues
- Source Code: github.com/resin-io-modules/resin-errors
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lintLicense
The project is licensed under the Apache 2.0 license.
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago