Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

balena-errors

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balena-errors

Collection of Balena JavaScript errors

  • 4.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.5K
decreased by-30.24%
Maintainers
1
Weekly downloads
 
Created
Source

balena-errors

Balena error collection

npm version dependencies Build Status Build status ![Gitter](https://badges.gitter.im/Join Chat.svg) Sauce Test Status

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.

Deprecation - note to developers / contributors

While this module has not been formally deprecated, we now believe that it is not good practice to add error classes to a separate module like balena-errors. Instead, error classes should be added to the same module that throws the errors. The reason is that downstream applications (like the balena CLI) may end up with multiple versions of balena-errors in the node_modules folder, in order to satisfy dependencies' own dependencies (e.g. a dependency module requires balena-errors v4, and another dependency module requires balena-errors v3). When this happens, testing error instances with instanceof fails: For example, an error class like BalenaExpiredToken loaded from balena-errors v4 would be considered incompatible (not the same class) as BalenaExpiredToken loaded from balena-errors v3. And this leads to bugs...

Installation

Install balena-errors by running:

$ npm install --save balena-errors

Documentation

errors~BalenaTooManyRequests

Kind: inner class of errors
Summary: Balena too many requests
Access: public

new BalenaTooManyRequests(nextValidRequestDate)

Returns: Error - error instance

ParamTypeDescription
nextValidRequestDateStringnext valid request string date

Example

throw new errors.BalenaTooManyRequests()

errors~BalenaInvalidLoginCredentials

Kind: inner class of errors
Summary: Balena invalid login credentials
Access: public

errors~BalenaInvalidDeviceType

Kind: inner class of errors
Summary: Balena invalid device type
Access: public

new BalenaInvalidDeviceType(type)

Returns: Error - error instance

ParamTypeDescription
typeStringdevice 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

ParamTypeDescription
typeStringdevice 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

ParamTypeDescription
tokenStringtoken

Example

throw new errors.BalenaMalformedToken('1234')

errors~BalenaSettingsPermissionError

Kind: inner class of errors
Summary: Balena settings permission error
Access: public

new BalenaSettingsPermissionError(error)

Returns: Error - error instance

ParamTypeDescription
errorErrorusually an EACCESS error

Example

throw new errors.BalenaSettingsPermissionError()

errors~BalenaSupervisorLockedError

Kind: inner class of errors
Summary: The device supervisor is locked
Access: public

new BalenaSupervisorLockedError(token)

Returns: Error - error instance

ParamTypeDescription
tokenStringtoken

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

ParamTypeDescription
tokenStringtoken

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

ParamTypeDescription
applicationString | Numberapplication name or id

Example

throw new errors.BalenaApplicationNotFound('MyApp')

errors~BalenaReleaseNotFound

Kind: inner class of errors
Summary: Balena release not found
Access: public

new BalenaReleaseNotFound(release)

Returns: Error - error instance

ParamTypeDescription
releaseString | Numberrelease commit or id

Example

throw new errors.BalenaReleaseNotFound(123)

errors~BalenaOrganizationMembershipRoleNotFound

Kind: inner class of errors
Summary: Balena organization membership role not found
Access: public

new BalenaOrganizationMembershipRoleNotFound(organizationMembershipRole)

Returns: Error - error instance

ParamTypeDescription
organizationMembershipRoleString | Numberorganization membership role name or id

Example

throw new errors.BalenaOrganizationMembershipRoleNotFound(123)

errors~BalenaApplicationMembershipRoleNotFound

Kind: inner class of errors
Summary: Balena application membership role not found
Access: public

new BalenaApplicationMembershipRoleNotFound(applicationMembershipRole)

Returns: Error - error instance

ParamTypeDescription
applicationMembershipRoleString | Numberapplication membership role name or id

Example

throw new errors.BalenaApplicationMembershipRoleNotFound(123)

errors~BalenaImageNotFound

Kind: inner class of errors
Summary: Balena image not found
Access: public

new BalenaImageNotFound(image)

Returns: Error - error instance

ParamTypeDescription
imageNumberimage 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

ParamTypeDescription
serviceString | Numberservice name or 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

ParamTypeDescription
deviceString | Numberdevice name or id

Example

throw new errors.BalenaDeviceNotFound('MyDevice')

errors~BalenaOrganizationNotFound

Kind: inner class of errors
Summary: Balena organization not found
Access: public

new BalenaOrganizationNotFound(organization)

Returns: Error - error instance

ParamTypeDescription
organizationString | Numberorganization name or id

Example

throw new errors.BalenaOrganizationNotFound('MyOrg')

errors~BalenaAmbiguousDevice

Kind: inner class of errors
Summary: Balena ambiguous device
Access: public

new BalenaAmbiguousDevice(device)

Returns: Error - error instance

ParamTypeDescription
deviceString | Numberdevice 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

ParamTypeDescription
applicationString | Numberapplication name or id

Example

throw new errors.BalenaAmbiguousApplication('MyApp')

errors~BalenaAmbiguousRelease

Kind: inner class of errors
Summary: Balena ambiguous release
Access: public

new BalenaAmbiguousRelease(release)

Returns: Error - error instance

ParamTypeDescription
releaseStringrelease hash

Example

throw new errors.BalenaAmbiguousRelease('7cf02a6')

errors~BalenaKeyNotFound

Kind: inner class of errors
Summary: Balena key not found
Access: public

new BalenaKeyNotFound(key)

Returns: Error - error instance

ParamTypeDescription
keyString | Numberkey 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], [responseHeaders])

Returns: Error - error instance

ParamTypeDescription
bodyStringresponse body
statusCodeNumberhttp status code
[requestOptions]Objectoptions used to make the request
[responseHeaders]Objectthe Headers that were included in the response

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.

Keywords

FAQs

Package last updated on 01 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc