Skip to content

Isn't there any way to capture errors? #44

@cuttlas

Description

@cuttlas

Is there a way to capture errors thrown by the render function?

In the following code, the render function throws an error (because my DB is not working), the server correctly returns a 500 error which also is logged in the console. I just want to capture this error so I can send it to Sentry, but using the normal express error handler middleware doesn't seem to work.

app.server.use((err, req, res, next) => {
   // NEVER GETS CALLED
});

app.layer("test_layer", function(tile, render) {
    render(
      "SELECT ST_AsGeoJSON(geom) as the_geom_geojson FROM mn_places WHERE ST_Intersects(geom, !bbox_4326!)"
    );
});

Is there a way to do this?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions