balena-errors
Balena error collection
![Gitter](https://badges.gitter.im/Join Chat.svg)
![Sauce Test Status](https://saucelabs.com/browser-matrix/balena-errors.svg)
Role
The intention of this module is to provide a collection of Error
instances to be used by the Balena 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 Balena SDK instead.
Installation
Install balena-errors
by running:
$ npm install --save balena-errors
Documentation
errors~BalenaInvalidDeviceType
Kind: inner class of errors
Summary: Balena invalid device type
Access: public
new BalenaInvalidDeviceType(type)
Returns: Error
- error instance
Param | Type | Description |
---|
type | String | device type |
Example
throw new errors.BalenaInvalidDeviceType('raspberry-pi')
errors~BalenaDiscontinuedDeviceType
Kind: inner class of errors
Summary: Balena discontinued device type
Access: public
new BalenaDiscontinuedDeviceType(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.BalenaDiscontinuedDeviceType('edge')
errors~BalenaMalformedToken
Kind: inner class of errors
Summary: Balena malformed token
Access: public
new BalenaMalformedToken(token)
Returns: Error
- error instance
Param | Type | Description |
---|
token | String | token |
Example
throw new errors.BalenaMalformedToken('1234')
errors~BalenaSupervisorLockedError
Kind: inner class of errors
Summary: The device supervisor is locked
Access: public
new BalenaSupervisorLockedError(token)
Returns: Error
- error instance
Param | Type | Description |
---|
token | String | token |
Example
throw new errors.BalenaSupervisorLockedError()
errors~BalenaExpiredToken
Kind: inner class of errors
Summary: Balena expired token
Access: public
new BalenaExpiredToken(token)
Returns: Error
- error instance
Param | Type | Description |
---|
token | String | token |
Example
throw new errors.BalenaExpiredToken('1234')
errors~BalenaApplicationNotFound
Kind: inner class of errors
Summary: Balena application not found
Access: public
new BalenaApplicationNotFound(application)
Returns: Error
- error instance
Param | Type | Description |
---|
application | String | Number | application name or id |
Example
throw new errors.BalenaApplicationNotFound('MyApp')
errors~BalenaBuildNotFound
Deprecated
Kind: inner class of errors
Summary: Balena build not found
Access: public
new BalenaBuildNotFound(build)
Returns: Error
- error instance
Param | Type | Description |
---|
build | Number | build id |
Example
throw new errors.BalenaBuildNotFound(123)
errors~BalenaReleaseNotFound
Kind: inner class of errors
Summary: Balena release not found
Access: public
new BalenaReleaseNotFound(release)
Returns: Error
- error instance
Param | Type | Description |
---|
release | Number | release id |
Example
throw new errors.BalenaReleaseNotFound(123)
errors~BalenaImageNotFound
Kind: inner class of errors
Summary: Balena image not found
Access: public
new BalenaImageNotFound(image)
Returns: Error
- error instance
Param | Type | Description |
---|
image | Number | image id |
Example
throw new errors.BalenaImageNotFound(123)
errors~BalenaServiceNotFound
Kind: inner class of errors
Summary: Balena service not found
Access: public
new BalenaServiceNotFound(service)
Returns: Error
- error instance
Param | Type | Description |
---|
service | Number | service id |
Example
throw new errors.BalenaServiceNotFound(123)
errors~BalenaDeviceNotFound
Kind: inner class of errors
Summary: Balena device not found
Access: public
new BalenaDeviceNotFound(device)
Returns: Error
- error instance
Param | Type | Description |
---|
device | String | Number | device name or id |
Example
throw new errors.BalenaDeviceNotFound('MyDevice')
errors~BalenaAmbiguousDevice
Kind: inner class of errors
Summary: Balena ambiguous device
Access: public
new BalenaAmbiguousDevice(device)
Returns: Error
- error instance
Param | Type | Description |
---|
device | String | Number | device name or id |
Example
throw new errors.BalenaAmbiguousDevice('MyDevice')
errors~BalenaAmbiguousApplication
Kind: inner class of errors
Summary: Balena ambiguous application
Access: public
new BalenaAmbiguousApplication(application)
Returns: Error
- error instance
Param | Type | Description |
---|
application | String | Number | application name or id |
Example
throw new errors.BalenaAmbiguousApplication('MyApp')
errors~BalenaKeyNotFound
Kind: inner class of errors
Summary: Balena key not found
Access: public
new BalenaKeyNotFound(key)
Returns: Error
- error instance
Param | Type | Description |
---|
key | String | Number | key name, id or value |
Example
throw new errors.BalenaKeyNotFound('MyKey')
errors~BalenaRequestError
Kind: inner class of errors
Summary: Balena request error
Access: public
new BalenaRequestError(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.BalenaRequestError('Unauthorized')
errors~BalenaNotLoggedIn
Kind: inner class of errors
Summary: Balena not logged in
Access: public
errors~BalenaInvalidParameterError
Kind: inner class of errors
Summary: Balena invalid parameter
Access: public
Support
If you're having any problem, please raise an issue on GitHub and the Balena team will be happy to help.
Tests
Run the test suite by doing:
$ gulp test
Contribute
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.