Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
fix: clean up error code checks; prevent OBS error unless there's an …
Browse files Browse the repository at this point in the history
…actual error code
  • Loading branch information
sircharlo committed Oct 16, 2024
1 parent bd36af4 commit 2c9cd83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/boot/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const get = async (url: string, params?: AxiosRequestConfig) => {
returnVal = await axios.get(url, { params }).catch((error) => {
if (
!(error instanceof AxiosError) ||
(error.status !== 400 && error.status !== 404)
![400, 404].includes(error.status ?? 0)
)
errorCatcher(error);
return { data: undefined };
Expand Down
10 changes: 1 addition & 9 deletions src/components/media/ObsStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,8 @@ const obsCloseHandler = () => {
const obsErrorHandler = (err: OBSWebSocketError) => {
obsMessage.value = 'obs.error';
if (
!(
err?.code === -1 ||
err?.code === 1001 ||
err?.code === 1006 ||
err?.code === 4009
)
) {
if (err?.code && ![-1, 1001, 1006, 4009].includes(err.code))
errorCatcher(err);
}
};
const obsConnect = async (setup?: boolean) => {
Expand Down

0 comments on commit 2c9cd83

Please sign in to comment.