Skip to content

Commit

Permalink
Исправлена ошибка вечного колеса при отсутсвии документа
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiontik committed Jan 13, 2024
1 parent 5af4d91 commit 29e1a03
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/frontend/components/Docs/DocMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ export default {
created: function() {
this.$parent.$on('appendError', (error) => {
let message = (error?.message || error);
if (error.config) {
const link = error.config.url.toString();
if (error.response) {
const description = error.response?.data?.error || JSON.stringify(error.response?.data);
message = (description ? `<pre>${description}</pre>` : '') + `${message}<br><br>URL:<a href="${link}" target="_blank">${link}</a><br><br>`;
}
message = (description ? `<pre>${description}</pre>` : '');
if (error.config) {
const link = error.config.url.toString();
message += `${message}<br><br>URL:<a href="${link}" target="_blank">${link}</a><br><br>`;
}
}
this.errors.push(
{
key: Date.now(),
Expand Down

0 comments on commit 29e1a03

Please sign in to comment.