Skip to content

Commit

Permalink
protocol.ts: rename Error to ErrorResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
throwaway96 committed Dec 4, 2023
1 parent 0525e29 commit 2bef694
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions services/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ type Response<T extends Record<string, any>> = T & {
returnValue: true;
};

// eslint-disable-next-line @typescript-eslint/no-redeclare
type Error<T extends Record<string, any>> = T & {
type ErrorResponse<T extends Record<string, any>> = T & {
returnValue: false;
errorText: string;
};
Expand All @@ -12,6 +11,6 @@ export function makeSuccess<T>(payload: T): Response<T> {
return { returnValue: true, ...payload };
}

export function makeError<T>(error: string, payload?: T): Error<T> {
export function makeError<T>(error: string, payload?: T): ErrorResponse<T> {
return { returnValue: false, errorText: error, ...payload };
}

0 comments on commit 2bef694

Please sign in to comment.