UNPKG

hypertune

Version:

[Hypertune](https://www.hypertune.com/) is the most flexible platform for feature flags, A/B testing, analytics and app configuration. Built with full end-to-end type-safety, Git-style version control and local, synchronous, in-memory flag evaluation. Opt

12 lines (11 loc) 288 B
export default function prefixError<T>(block: () => T, prefix: string): T { try { return block(); } catch (error) { if (error instanceof Error) { error.message = prefix + error.message; throw error; } throw new Error(prefix + JSON.stringify(error)); } }