We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c89a67 + 89a7a32 commit 8c723c0Copy full SHA for 8c723c0
rest/getCodeBlock.ts
@@ -27,7 +27,13 @@ const getCodeBlock_toRequest: GetCodeBlock["toRequest"] = (
27
28
const getCodeBlock_fromResponse: GetCodeBlock["fromResponse"] = async (res) => {
29
if (!res.ok) {
30
- return makeError<NotFoundError | NotLoggedInError | NotMemberError>(res);
+ return res.status === 404 &&
31
+ res.headers.get("Content-Type")?.includes?.("text/plain")
32
+ ? {
33
+ ok: false,
34
+ value: { name: "NotFoundError", message: "Code block is not found" },
35
+ }
36
+ : makeError<NotFoundError | NotLoggedInError | NotMemberError>(res);
37
}
38
return { ok: true, value: await res.text() };
39
};
0 commit comments