export function asStructuredError()

in src/shared/model/Errors.ts [111:121]


export function asStructuredError(
	error?: GatewayError,
): StructuredGatewayError | undefined {
	if (typeof error === 'string') {
		return {
			message: error,
			severity: 'UNEXPECTED',
		};
	}
	return error;
}