@foundry-ai/api-errors
Version:
Common errors that can be thrown and caught reliably across services
16 lines (11 loc) • 537 B
text/typescript
import { suite, test } from 'mocha-typescript';
import { expect } from 'chai';
import { BaseError } from '../src/baseError';
class BaseErrorDefaults {
public error: BaseError;
before() { this.error = new BaseError('message', 123, 'base_error'); }
name() { expect(this.error.name).to.equal('Error'); }
type() { expect(this.error.type).to.equal('base_error'); }
message() { expect(this.error.message).to.equal('message'); }
status() { expect(this.error.status).to.equal(123); }
}