Not catching errors in isoWrapper.
This commit is contained in:
parent
c71878ef6b
commit
27bb9c3d6c
3 changed files with 12 additions and 28 deletions
15
package.json
15
package.json
|
@ -17,16 +17,9 @@
|
||||||
"start": "yarn build:dev --watch"
|
"start": "yarn build:dev --watch"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{ts,tsx,js}": [
|
"*.{ts,tsx,js}": ["prettier --write", "eslint --fix"],
|
||||||
"prettier --write",
|
"*.{css, scss}": ["prettier --write"],
|
||||||
"eslint --fix"
|
"package.json": ["sortpack"]
|
||||||
],
|
|
||||||
"*.{css, scss}": [
|
|
||||||
"prettier --write"
|
|
||||||
],
|
|
||||||
"package.json": [
|
|
||||||
"sortpack"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-proposal-decorators": "^7.21.0",
|
"@babel/plugin-proposal-decorators": "^7.21.0",
|
||||||
|
@ -60,7 +53,7 @@
|
||||||
"inferno-server": "^8.1.1",
|
"inferno-server": "^8.1.1",
|
||||||
"isomorphic-cookie": "^1.2.4",
|
"isomorphic-cookie": "^1.2.4",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"lemmy-js-client": "0.17.2-rc.20",
|
"lemmy-js-client": "0.17.2-rc.21",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"markdown-it": "^13.0.1",
|
"markdown-it": "^13.0.1",
|
||||||
"markdown-it-container": "^3.0.0",
|
"markdown-it-container": "^3.0.0",
|
||||||
|
|
|
@ -59,19 +59,10 @@ export async function apiWrapper<ResponseType>(
|
||||||
export function apiWrapperIso<ResponseType>(
|
export function apiWrapperIso<ResponseType>(
|
||||||
res: ResponseType
|
res: ResponseType
|
||||||
): RequestState<ResponseType> {
|
): RequestState<ResponseType> {
|
||||||
try {
|
return {
|
||||||
return {
|
state: "success",
|
||||||
state: "success",
|
data: res,
|
||||||
data: res,
|
};
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`API error: ${error}`);
|
|
||||||
toast(i18n.t(error), "danger");
|
|
||||||
return {
|
|
||||||
state: "failed",
|
|
||||||
msg: error,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class HttpService {
|
export class HttpService {
|
||||||
|
|
|
@ -5341,10 +5341,10 @@ leac@^0.6.0:
|
||||||
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
|
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
|
||||||
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==
|
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==
|
||||||
|
|
||||||
lemmy-js-client@0.17.2-rc.20:
|
lemmy-js-client@0.17.2-rc.21:
|
||||||
version "0.17.2-rc.20"
|
version "0.17.2-rc.21"
|
||||||
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.20.tgz#64138cb48fa57f096ee50b33ae18feec10b5f9d7"
|
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.21.tgz#eeea8a0d12c6e233193635521e11974190123adc"
|
||||||
integrity sha512-Y8jnGSCNNc65LaFOwE/YqQU+o2Q/PrEz2RW7ASo/zjPWxpoBT4tm1lPveXhTsHlhhvMaFvmK1LyzvIdq2AO5ZQ==
|
integrity sha512-IvZLH18ULX0xRNcvhHwm9JkfYUTwNK8BCLe36wp/NPP/lxqPeLIQGjddArNqGjeXQyoTrlrAiNl/JbMNGmzKXQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-fetch "^3.1.5"
|
cross-fetch "^3.1.5"
|
||||||
form-data "^4.0.0"
|
form-data "^4.0.0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue