// Integration errors are external errors to Superblocks and thrown from API execution
import { isEmpty } from 'lodash';
import { Code as CommonErrorCode } from '@superblocksteam/types';
export class IntegrationError extends Error {
    code;
    internalCode;
    constructor(message, errorCode, internalCode) {
        super(message);
        this.name = 'IntegrationError';
        this.code = errorCode ?? CommonErrorCode.UNSPECIFIED;
        this.internalCode = isEmpty(internalCode) ? {} : internalCode;
    }
}
//# sourceMappingURL=integration.js.map