New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@keiser/metrics-sdk

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keiser/metrics-sdk - npm Package Compare versions

Comparing version 0.4.3 to 0.5.0

types/error.d.ts

2

package.json
{
"name": "@keiser/metrics-sdk",
"version": "0.4.3",
"version": "0.5.0",
"description": "Keiser Metrics SDK",

@@ -5,0 +5,0 @@ "keywords": [

@@ -107,3 +107,3 @@ # Keiser Metrics SDK

All errors will be in the same format which includes a `code` value that can be used to determine the type of error, as well as a `message`.
All errors will be thrown as a typed error instance corresponding to the reason for the error, with the global [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) as the base instance, and an intermediate category type inheritance (for easier bucketing).

@@ -114,5 +114,11 @@ ```ts

userSession = await metrics.authenticateWithCredentials({email: 'demo@keiser.com', password: 'wrongPassword'})
} catch (exception) {
if (exception.error.code === 603) {
this.userCredentialsIncorrect()
} catch (error) {
if (error instanceof RequestError) {
if (error instanceof InvalidCredentialsError) {
this.userCredentialsIncorrect()
} else if (error instanceof ValidationError) {
this.userCredentialsValidationError()
}
} else if (error instanceof ServerError) {
this.serverDown()
}

@@ -122,17 +128,24 @@ }

### Error Categories
| Name | Purpose |
| --------------- | ------------------------------------------------------------ |
| RequestError | Issue with the parameters provided for the request |
| SessionError | Issue with the session instance (session is no longer valid) |
| ServerError | Issue with the server (potentially overloaded or offline) |
| ConnectionError | Issue with connection to server |
### Common Errors
| Code | Name | Message |
| ---- | ---- | ------- |
| 601 | MissingParams | missing parameter(s) for action |
| 603 | InvalidCredentials | credentials do not match any active users |
| 604 | ValidationError | validation error in parameters |
| 605 | UnknownEntity | entity does not exist |
| 606 | DuplicateEntity | entity already exists |
| 621 | UnauthorizedResource | unauthorized to access resource |
| 625 | ActionPrevented | action cannot be performed |
| 630 | FacilityAccessControlError | action is prevented due to facility access control limitations |
| Name | Category | Message |
| --------------------- | ------------ | -------------------------------------------------------------- |
| MissingParams | RequestError | missing parameter(s) for action |
| InvalidCredentials | RequestError | credentials do not match any active users |
| Validation | RequestError | validation error in parameters |
| UnknownEntity | RequestError | entity does not exist |
| DuplicateEntity | RequestError | entity already exists |
| UnauthorizedResource | RequestError | unauthorized to access resource |
| ActionPrevented | RequestError | action cannot be performed |
| FacilityAccessControl | RequestError | action is prevented due to facility access control limitations |
A full list of errors is available here: [Metrics API Errors List](https://metrics-api.keiser.com/api?action=core:errors)
## Closing Connection

@@ -139,0 +152,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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