sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.47k stars 716 forks source link

Continue on parseJSON error #708

Closed dmahmalat closed 4 months ago

dmahmalat commented 6 months ago

In some instances (where an ingress redirects 4xx errors for instance), the response by the server on error will not necessarily be neatly JSON formatted.

This causes pgweb to halt loading the page on a jQuery error. This PR adds a try catch statement to catch parseJSON errors and resume code execution on a failed API call.

sosedoff commented 4 months ago

Thanks for the improvement!