Skip to content

Errors

All SDK errors extend BaseError, which extends HttpClientError from @http-client-toolkit/core. Every error includes a message and a help property with guidance for resolving the issue.

Thrown when the API key is invalid or missing.

import { UnauthorizedError } from 'comic-vine-sdk';
try {
const issue = await client.issue.retrieve(1);
} catch (error) {
if (error instanceof UnauthorizedError) {
console.error('Check your API key');
}
}

Thrown when the requested resource does not exist.

import { ObjectNotFoundError } from 'comic-vine-sdk';
try {
const issue = await client.issue.retrieve(999999);
} catch (error) {
if (error instanceof ObjectNotFoundError) {
console.error('Resource not found');
}
}

Thrown when the request contains invalid filter parameters.

import { FilterError } from 'comic-vine-sdk';
try {
const issues = await client.issue.list({ filter: { invalid: 'field' } });
} catch (error) {
if (error instanceof FilterError) {
console.error('Invalid filter:', error.message);
}
}

Thrown for general API request failures.

Thrown for unexpected API errors that don’t match a specific error type.

Thrown when accessing a resource that requires a subscriber account.

Thrown when the constructed request URL is malformed.

Thrown when a JSONP callback parameter is missing from the request.

Thrown when the client configuration is invalid. This is a client-side validation error that occurs before any API call is made.

import { OptionsValidationError } from 'comic-vine-sdk';
try {
const client = new ComicVine({ apiKey: '' });
} catch (error) {
if (error instanceof OptionsValidationError) {
console.error('Invalid configuration:', error.message);
}
}
HttpClientError (@http-client-toolkit/core)
└── BaseError
├── UnauthorizedError
├── ObjectNotFoundError
├── FilterError
├── GenericRequestError
├── GenericError
├── SubscriberOnlyError
├── UrlFormatError
├── JsonpCallbackMissingError
└── OptionsValidationError
PropertyTypeDescription
messagestringError description
helpstringGuidance for resolving the error
namestringError class name
stackstringStack trace