mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-22 19:01:27 +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-extra-parens": 0,
|
||||
"no-return-assign": 0,
|
||||
"no-throw-literal": 0,
|
||||
"no-throw-literal": 1,
|
||||
"no-trailing-spaces": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"no-useless-constructor": 0,
|
||||
|
|
|
@ -1471,11 +1471,11 @@ export class LemmyHttp {
|
|||
try {
|
||||
json = await response.json();
|
||||
} catch (error) {
|
||||
throw response.statusText;
|
||||
throw new Error(response.statusText);
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw json["error"] ?? response.statusText;
|
||||
throw new Error(json["error"] ?? response.statusText);
|
||||
} else {
|
||||
return json;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue