05e00d2c5c
* chore(acc): put permission gql in correct place * feat(acc): swap to new rvt import * fix(acc): add oda secrets * feat(acc): auth cookies * feat(acc): introduce integrations as workspace setting * feat(acc): create sync item from models * fix(acc): bump * fix(acc): naming lost in merge * feat(acc): no acc tab - table under settings * chore(acc): new sync but will disapper * feat(acc): see statuses over model list * chore(acc): fix return type * chore(acc): type saga * chore(acc): status badge * chore(acc): refactor acc gql (#5556) * checkpoint * fix(acc): refactor gql items * feat(acc): double button * chore(acc): gqlgen * fix(acc): model ids are not project ids * chore(acc): bump function version * chore(acc): split up clients * feat(acc): more-optimised gql folder fetching schema * feat(acc): acc folder contents gql impl * feat(acc): apollo cache optimisations * chore(acc): gqlgen * fix(acc): return something for * fix(acc): handle null values correctly * chore(acc): specify prod functions --------- Co-authored-by: Chuck Driesler <chuck@speckle.systems>
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
import { BaseError } from '@/modules/shared/errors/base'
|
|
|
|
export class AccModuleDisabledError extends BaseError {
|
|
static defaultMessage = 'ACC integration module is disabled'
|
|
static code = 'ACC_MODULE_DISABLED'
|
|
static statusCode = 423
|
|
}
|
|
|
|
export class AccNotAuthorizedError extends BaseError {
|
|
static defaultMessage = 'ACC token missing or not authorized'
|
|
static code = 'ACC_MODULE_NOT_AUTHORIZED'
|
|
static statusCode = 401
|
|
}
|
|
|
|
export class AccNotYetImplementedError extends BaseError {
|
|
static defaultMessage =
|
|
'This functionality for the ACC integration is not yet implemented'
|
|
static code = 'ACC_MODULE_NOT_YET_IMPLEMENTED'
|
|
static statusCode = 501
|
|
}
|
|
|
|
export class AutodeskApiRequestError extends BaseError {
|
|
static defaultMessage = 'Error during external request to Autodesk'
|
|
static code = 'ACC_AUTODESK_REQUEST_ERROR'
|
|
static statusCode = 500
|
|
|
|
constructor(method: string, endpoint: string) {
|
|
super()
|
|
this.message = `Failed to issue ${method} request to ${endpoint}`
|
|
}
|
|
}
|
|
|
|
export class DuplicateSyncItemError extends BaseError {
|
|
static defaultMessage = 'A sync item with this lineage urn already exists.'
|
|
static code = 'ACC_DUPLICATE_SYNC_ITEM_LINEAGE_URN'
|
|
static statusCode = 423
|
|
|
|
constructor(lineageUrn: string) {
|
|
super()
|
|
this.message = `A sync item with lineage urn "${lineageUrn}" already exists.`
|
|
}
|
|
}
|
|
|
|
export class SyncItemNotFoundError extends BaseError {
|
|
static defaultMessage = 'Sync item not found'
|
|
static code = 'ACC_SYNC_ITEM_NOT_FOUND'
|
|
static statusCode = 404
|
|
}
|
|
|
|
export class SyncItemAutomationTriggerError extends BaseError {
|
|
static defaultMessage = 'Failed to trigger automation associated with sync item'
|
|
static code = 'ACC_SYNC_ITEM_AUTOMATION_TRIGGER_ERROR'
|
|
static statusCode = 422
|
|
}
|
|
|
|
export class SyncItemUnsupportedFileExtensionError extends BaseError {
|
|
static defaultMessage = 'Cannot sync this file type from ACC'
|
|
static code = 'ACC_SYNC_ITEM_UNSUPPORTED_FILE_EXTENSION'
|
|
static statusCode = 422
|
|
|
|
constructor(fileExtension: string) {
|
|
super()
|
|
this.message = `Received sync item update with unsupported file extension ${fileExtension}`
|
|
}
|
|
}
|