Skip to content

Commit

Permalink
Extend UnprocessableEntityException
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Mar 11, 2024
1 parent 372bf03 commit 6e5c04c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
5 changes: 2 additions & 3 deletions src/domain/relay/errors/invalid-multisend.error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HttpException, HttpStatus } from '@nestjs/common';
import { UnprocessableEntityException } from '@nestjs/common';

export class InvalidMultiSendError extends HttpException {
export class InvalidMultiSendError extends UnprocessableEntityException {
constructor() {
super(
'Invalid multiSend call. The batch is not all execTransaction calls to same address.',
HttpStatus.UNPROCESSABLE_ENTITY,
);
}
}
5 changes: 2 additions & 3 deletions src/domain/relay/errors/invalid-transfer.error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HttpException, HttpStatus } from '@nestjs/common';
import { UnprocessableEntityException } from '@nestjs/common';

export class InvalidTransferError extends HttpException {
export class InvalidTransferError extends UnprocessableEntityException {
constructor() {
super(
'Invalid transfer. The proposed transfer is not an execTransaction/multiSend to another party or createProxyWithNonce call.',
HttpStatus.UNPROCESSABLE_ENTITY,
);
}
}
5 changes: 2 additions & 3 deletions src/domain/relay/errors/unofficial-master-copy.error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HttpException, HttpStatus } from '@nestjs/common';
import { UnprocessableEntityException } from '@nestjs/common';

export class UnofficialMasterCopyError extends HttpException {
export class UnofficialMasterCopyError extends UnprocessableEntityException {
constructor() {
super(
'Safe attempting to relay is not official. Only official Safe singletons are supported.',
HttpStatus.UNPROCESSABLE_ENTITY,
);
}
}
5 changes: 2 additions & 3 deletions src/domain/relay/errors/unofficial-multisend.error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HttpException, HttpStatus } from '@nestjs/common';
import { UnprocessableEntityException } from '@nestjs/common';

export class UnofficialMultiSendError extends HttpException {
export class UnofficialMultiSendError extends UnprocessableEntityException {
constructor() {
super(
'MultiSend contract is not official. Only official MultiSend contracts are supported.',
HttpStatus.UNPROCESSABLE_ENTITY,
);
}
}
5 changes: 2 additions & 3 deletions src/domain/relay/errors/unofficial-proxy-factory.error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HttpException, HttpStatus } from '@nestjs/common';
import { UnprocessableEntityException } from '@nestjs/common';

export class UnofficialProxyFactoryError extends HttpException {
export class UnofficialProxyFactoryError extends UnprocessableEntityException {
constructor() {
super(
'ProxyFactory contract is not official. Only official ProxyFactory contracts are supported.',
HttpStatus.UNPROCESSABLE_ENTITY,
);
}
}

0 comments on commit 6e5c04c

Please sign in to comment.