Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion debug_toolbar/static/debug_toolbar/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function ajax(url, init) {
return fetch(url, init)
.then(function (response) {
if (response.ok) {
return response.json();
return response.json().catch(function(error){
return Promise.reject(
new Error("The response is a invalid Json object : " + error)
);
});
}
return Promise.reject(
new Error(response.status + ": " + response.statusText)
Expand Down
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Pending
* Raised the minimum Django version to 4.2.
* Automatically support Docker rather than having the developer write a
workaround for ``INTERNAL_IPS``.
* Display a better error message when the toolbar's requests
return invalid json.

4.3.0 (2024-02-01)
------------------
Expand Down