mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-26 14:21:12 +00:00
Handle 413 response on image uploads (#154)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
0a9c151b8e
commit
d497a1efea
1 changed files with 4 additions and 0 deletions
|
@ -1284,6 +1284,10 @@ export class LemmyHttp {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (response.status === 413) {
|
||||||
|
return { msg: "too_large" };
|
||||||
|
}
|
||||||
|
|
||||||
const responseJson = await response.json();
|
const responseJson = await response.json();
|
||||||
|
|
||||||
if (responseJson.msg === "ok") {
|
if (responseJson.msg === "ok") {
|
||||||
|
|
Loading…
Reference in a new issue