GeoLeaf Core API - v3.19.0
    Preparing search index...

    Class ValidationError

    Data failed validation — invalid coordinates, a missing parameter, a malformed shape.

    Code: VALIDATION_ERROR.

    throw new GeoLeaf.Errors.ValidationError("Latitude must be between -90 and 90", {
    lat: 95,
    lng: -73,
    expected: "Range: -90 to 90",
    });

    // Targeted catch — around YOUR code that throws it, like the line above.
    // `GeoLeaf.Core.init()` never throws: a failed initialisation logs and returns `null`.
    try {
    checkCoordinates(95, -73); // your own validation, throwing the ValidationError above
    } catch (error) {
    if (error instanceof GeoLeaf.Errors.ValidationError) {
    console.error("Erreur de validation:", error.context);
    }
    }

    Hierarchy (View Summary)

    Index
    context: ErrorContext
    timestamp: string
    code: string