{"version":3,"file":"error-handling.mjs","names":["defaultErrorHandler","e","level","console","warn"],"sources":["../src/error-handling.ts"],"sourcesContent":["/**\n * Error level. Diagnostics less important than these levels directly go to console.\n *\n * @since 0.1.7 (`@hi18n/core`)\n */\nexport type ErrorLevel = \"error\" | \"warn\";\n\n/**\n * @since 0.1.7 (`@hi18n/core`)\n */\nexport type ErrorHandler = (e: Error, level: ErrorLevel) => void;\n\n/**\n * By default, it just throws the error if `level === \"error\"` and reports in the console otherwise.\n *\n * @since 0.1.7 (`@hi18n/core`)\n */\nexport function defaultErrorHandler(e: Error, level: ErrorLevel) {\n  switch (level) {\n    case \"error\":\n      throw e;\n    case \"warn\":\n      console.warn(e);\n      break;\n  }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAT,CAA6BC,CAA7B,EAAuCC,KAAvC,EAA0D;EAC/D,QAAQA,KAAR;IACE,KAAK,OAAL;MACE,MAAMD,CAAN;;IACF,KAAK,MAAL;MACEE,OAAO,CAACC,IAAR,CAAaH,CAAb;MACA;EALJ;AAOD"}