resin-errors
Resin.io error collection
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-errors
Documentation
- 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 '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 '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 '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
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 '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 '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 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 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 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 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 '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 '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 '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 '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 '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 test
Contribute
- 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 lint
License
The project is licensed under the Apache 2.0 license.