type SuccessResponse<Body> = {
  success: true;
  body: Body;
};

export type ErrorMessage = string;

export const isErrorMessage = (error: unknown): error is ErrorMessage => typeof error === 'string';

type ErrorResponse = {
  success: false;
  message: ErrorMessage;
};

export type BaseResponse<Body> = SuccessResponse<Body> | ErrorResponse;