Something went wrong. Try again.
A simple to-do app focused on tasks that can be completed within a specific time span. taskline.tobinio.dev
Something went wrong. Try again.
12345678910111213141516171819202122232425// plugins/my-error.tsexport class ApiError extends Error { statusCode?: number; data?: unknown;
constructor(message: string, statusCode?: number, data?: unknown) { super(message); this.name = "ApiError"; this.statusCode = statusCode; this.data = data; }}
export default definePayloadPlugin(() => { definePayloadReducer( "ApiError", (data) => data instanceof ApiError && [data.message, data.statusCode, data.data], ); definePayloadReviver( "ApiError", ([message, statusCode, data]) => new ApiError(message, statusCode, data), );});