Skip to content

Commit e5bbfac

Browse files
apiProxy - Check if return have message, if yes return Error
1 parent e918074 commit e5bbfac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/services/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,6 @@ export async function proxyApi(url) {
309309
});
310310
if (!res.ok) throw new Error(res.statusText);
311311
res = (await res.json());
312+
if (res.message) throw new Error(res.message);
312313
return res;
313314
}

0 commit comments

Comments
 (0)