mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Update packages/microservices/errors/invalid-tcp-data-reception.exception.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { RuntimeException } from '@nestjs/core/errors/exceptions/runtime.exception';
|
||||
|
||||
export class InvalidTcpDataReceptionException extends RuntimeException {
|
||||
constructor(err: string) {
|
||||
const _errMsg = err.includes('Corrupted length value')
|
||||
constructor(err: string | Error) {
|
||||
const errMsgStr =
|
||||
typeof err === 'string'
|
||||
? err
|
||||
: err && typeof err === 'object' && 'message' in err && typeof (err as any).message === 'string'
|
||||
? (err as any).message
|
||||
: String(err);
|
||||
const _errMsg = errMsgStr.includes('Corrupted length value')
|
||||
? `Corrupted length value of the received data supplied in a packet`
|
||||
: `The invalid received message from tcp server`;
|
||||
super(_errMsg);
|
||||
|
||||
Reference in New Issue
Block a user