// Booking errors the merchant can fix themselves come from the plugin's REST API with a translated // message to show instead of the generic "An error occurred" const MERCHANT_ACTIONABLE_BOOKING_ERRORS = ['plugin_update_required'] export const merchantActionableBookingError = ( error: unknown ): string | undefined => { if (typeof error !== 'object' || error === null) { return undefined } const { code, message } = error as { code?: unknown; message?: unknown } return typeof code === 'string' && MERCHANT_ACTIONABLE_BOOKING_ERRORS.includes(code) && typeof message === 'string' ? message : undefined }