From 6e5c04c2e201f25331d0b0abc23eeb4e1c11e2d1 Mon Sep 17 00:00:00 2001 From: iamacook Date: Mon, 11 Mar 2024 17:13:45 +0100 Subject: [PATCH] Extend `UnprocessableEntityException` --- src/domain/relay/errors/invalid-multisend.error.ts | 5 ++--- src/domain/relay/errors/invalid-transfer.error.ts | 5 ++--- src/domain/relay/errors/unofficial-master-copy.error.ts | 5 ++--- src/domain/relay/errors/unofficial-multisend.error.ts | 5 ++--- src/domain/relay/errors/unofficial-proxy-factory.error.ts | 5 ++--- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/domain/relay/errors/invalid-multisend.error.ts b/src/domain/relay/errors/invalid-multisend.error.ts index 089dd98dca..54a6cf8545 100644 --- a/src/domain/relay/errors/invalid-multisend.error.ts +++ b/src/domain/relay/errors/invalid-multisend.error.ts @@ -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, ); } } diff --git a/src/domain/relay/errors/invalid-transfer.error.ts b/src/domain/relay/errors/invalid-transfer.error.ts index 63203ca245..03aeac2f8d 100644 --- a/src/domain/relay/errors/invalid-transfer.error.ts +++ b/src/domain/relay/errors/invalid-transfer.error.ts @@ -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, ); } } diff --git a/src/domain/relay/errors/unofficial-master-copy.error.ts b/src/domain/relay/errors/unofficial-master-copy.error.ts index 182a1d1c77..8c47dbe36d 100644 --- a/src/domain/relay/errors/unofficial-master-copy.error.ts +++ b/src/domain/relay/errors/unofficial-master-copy.error.ts @@ -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, ); } } diff --git a/src/domain/relay/errors/unofficial-multisend.error.ts b/src/domain/relay/errors/unofficial-multisend.error.ts index 958833ade6..079868b69a 100644 --- a/src/domain/relay/errors/unofficial-multisend.error.ts +++ b/src/domain/relay/errors/unofficial-multisend.error.ts @@ -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, ); } } diff --git a/src/domain/relay/errors/unofficial-proxy-factory.error.ts b/src/domain/relay/errors/unofficial-proxy-factory.error.ts index bfcfb627f3..4ece3dfea9 100644 --- a/src/domain/relay/errors/unofficial-proxy-factory.error.ts +++ b/src/domain/relay/errors/unofficial-proxy-factory.error.ts @@ -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, ); } }