Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module utils/format-error

    Turning an unknown thrown value into something readable.

    catch (error) gives unknown, and the two obvious things to do with it are both incomplete in the same place: String(error) on an Error yields "Error: msg" but on a DOMException loses the name, while directly using JSON.stringify on an Error yields "{}" because name / message / stack are all non-enumerable. That second one is not hypothetical — it is why a real bug report read OPFSStore metadata save failed {} with the cause entirely absent.

    The idiom was inlined ~31 times and file-private in a 32nd (data/points/points-spatial-index-loader.ts); this is that helper promoted so the console formatters and any log site can share one definition.

    getErrorMessage
    formatErrorForDisplay
    isGenuineError
    isErrorLike
    getErrorStack