mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-22 20:31:12 +00:00
Co-authored-by: Arseniy Golushkov <ars@MacBook-Pro-Arseniy.local>
This commit is contained in:
parent
a27ebd024b
commit
79710354bd
2 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@
|
||||||
"no-duplicate-imports": 0,
|
"no-duplicate-imports": 0,
|
||||||
"no-extra-parens": 0,
|
"no-extra-parens": 0,
|
||||||
"no-return-assign": 0,
|
"no-return-assign": 0,
|
||||||
"no-throw-literal": 0,
|
"no-throw-literal": 1,
|
||||||
"no-trailing-spaces": 0,
|
"no-trailing-spaces": 0,
|
||||||
"no-unused-expressions": 0,
|
"no-unused-expressions": 0,
|
||||||
"no-useless-constructor": 0,
|
"no-useless-constructor": 0,
|
||||||
|
|
|
@ -1471,11 +1471,11 @@ export class LemmyHttp {
|
||||||
try {
|
try {
|
||||||
json = await response.json();
|
json = await response.json();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw response.statusText;
|
throw new Error(response.statusText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw json["error"] ?? response.statusText;
|
throw new Error(json["error"] ?? response.statusText);
|
||||||
} else {
|
} else {
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue