Add links-mode embed thumbnails, item metadata, and media filters
This commit is contained in:
+5
-1
@@ -30,7 +30,11 @@ async function request(path, options) {
|
||||
} catch {
|
||||
throw new Error(`request failed (${response.status})`);
|
||||
}
|
||||
if (!body.ok) throw new Error(body.error ?? `request failed (${response.status})`);
|
||||
if (!body.ok) {
|
||||
const error = new Error(body.error ?? `request failed (${response.status})`);
|
||||
if (body.code) error.code = body.code;
|
||||
throw error;
|
||||
}
|
||||
return body.result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user