@spree/storefront-api-v2-sdk
Version:
Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on
14 lines (11 loc) • 466 B
text/typescript
import type { RawFetchResponse } from '../interfaces/RawFetchResponse'
import SpreeSDKError from './SpreeSDKError'
export default class SpreeError extends SpreeSDKError {
public serverResponse: RawFetchResponse
constructor(serverResponse: RawFetchResponse) {
super(`Spree returned a HTTP ${serverResponse.status} error code`)
Object.setPrototypeOf(this, SpreeError.prototype)
this.name = 'SpreeError'
this.serverResponse = serverResponse
}
}