Minor fixes
This commit is contained in:
@@ -974,13 +974,13 @@ const Stegasoo = {
|
||||
body: formData,
|
||||
});
|
||||
|
||||
const result = await response.json().catch(() => null);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to start encode');
|
||||
throw new Error((result && result.error) || 'Failed to start encode');
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (result.error) {
|
||||
if (result && result.error) {
|
||||
throw new Error(result.error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user