Skip to content

Commit

Permalink
Add compounderror
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed Feb 4, 2025
1 parent b9851ee commit 03cf584
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/backend/src/nest/storage/channels/channel.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { Injectable } from '@nestjs/common'
import { EventsType, LogEntry } from '@orbitdb/core'

import { QuietLogger } from '@quiet/logger'
import { ChannelMessage, MessagesLoadedPayload, PublicChannel, PushNotificationPayload } from '@quiet/types'
import {
ChannelMessage,
CompoundError,
MessagesLoadedPayload,
PublicChannel,
PushNotificationPayload,
} from '@quiet/types'

import { createLogger } from '../../common/logger'
import { EventStoreBase } from '../base.store'
Expand Down
9 changes: 9 additions & 0 deletions packages/types/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@ export enum ErrorMessages {
// Storage Server
STORAGE_SERVER_CONNECTION_FAILED = 'Connecting to storage server failed',
}

export class CompoundError<T extends Error> extends Error {
constructor(
message: string,
public readonly originalError: T
) {
super(message)
}
}

0 comments on commit 03cf584

Please sign in to comment.