[openstreetmap/openstreetmap-website] Display error message if note creation fails (PR #7132)
Marwin Hochfelsner
notifications at github.com
Tue Jun 9 19:20:54 UTC 2026
@hlfan approved this pull request.
I like how this is taking shape!
> + .then((response) => {
+ if (response.ok) {
+ return response;
+ } else {
+ throw new Error(`Got response with status ${response.status} ${response.statusText}`);
+ }
+ })
.then(response => response.json())
One stylistic idea/nit to group the callbacks more:
```suggestion
.then(resp => {
if (resp.ok) return resp.json();
throw new Error(`Got response with status ${resp.status} ${resp.statusText}`);
})
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7132#pullrequestreview-4461704954
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7132/review/4461704954 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260609/55497a18/attachment.htm>
More information about the rails-dev
mailing list