Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Gracefully Handle Tile Server Errors #51

@pjdufour

Description

@pjdufour

First...

  • I've made sure there are no duplicate issues

Issue type

  • bug report
  • feature request

If this is a bug report (if not, please remove this section)

Description

When railgun returns and error from the server, including one with a valid JSON response body, the following error occurs on the client.

map.component.js:366 Uncaught TypeError: Cannot read property 'forEach' of undefined
    at XMLHttpRequest.r.onload (map.component.js:366)

Expected behavior

If the response code is not equal to 200, then log the error body to the console. If the error body if valid JSON, then log the parsed body.

If the response code is equal to 200, check that the response body includes a features property before attempting to do forEach on the array.

Current behavior

See description.

Steps to reproduce

Corrupt railgun config.

Environment

N.A.

Device:

N.A.

Browser:

N.A.

Additional helpful info/screenshots

None

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