Using console.error for error logs. (#517)

This commit is contained in:
Dessalines 2021-12-02 11:46:32 -05:00 committed by GitHub
parent a4f023d250
commit e976c45f88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 4 deletions

View file

@ -90,6 +90,7 @@ server.get("/*", async (req, res) => {
// Redirect to the 404 if there's an API error // Redirect to the 404 if there's an API error
if (routeData[0] && routeData[0].error) { if (routeData[0] && routeData[0].error) {
let errCode = routeData[0].error; let errCode = routeData[0].error;
console.error(errCode);
return res.redirect(`/404?err=${errCode}`); return res.redirect(`/404?err=${errCode}`);
} }
@ -174,7 +175,8 @@ server.get("/*", async (req, res) => {
</html> </html>
`); `);
} catch (err) { } catch (err) {
console.log(err); console.error(err);
return res.redirect(`/404?err=${err}`);
} }
}); });

View file

@ -104,6 +104,7 @@ export class ImageUploadForm extends Component<
.catch(error => { .catch(error => {
i.state.loading = false; i.state.loading = false;
i.setState(i.state); i.setState(i.state);
console.error(error);
toast(error, "danger"); toast(error, "danger");
}); });
} }

View file

@ -365,6 +365,7 @@ export class MarkdownTextArea extends Component<
.catch(error => { .catch(error => {
i.state.imageLoading = false; i.state.imageLoading = false;
i.setState(i.state); i.setState(i.state);
console.error(error);
toast(error, "danger"); toast(error, "danger");
}); });
} }

View file

@ -796,7 +796,7 @@ export class Settings extends Component<any, SettingsState> {
true true
); );
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
}, 400), }, 400),
false false

View file

@ -565,6 +565,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
.catch(error => { .catch(error => {
i.state.imageLoading = false; i.state.imageLoading = false;
i.setState(i.state); i.setState(i.state);
console.error(error);
toast(error, "danger"); toast(error, "danger");
}); });
} }

View file

@ -785,7 +785,7 @@ export class Search extends Component<any, SearchState> {
choices.unshift({ value: "0", label: i18n.t("all") }); choices.unshift({ value: "0", label: i18n.t("all") });
this.communityChoices.setChoices(choices, "value", "label", true); this.communityChoices.setChoices(choices, "value", "label", true);
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
}, 400), }, 400),
false false

View file

@ -27,7 +27,7 @@ export class WebSocketService {
try { try {
obs.next(JSON.parse(e.data.toString())); obs.next(JSON.parse(e.data.toString()));
} catch (err) { } catch (err) {
console.log(err); console.error(err);
} }
}) })
.onOpen(() => { .onOpen(() => {