Get Backend Error Message

const client = Http.client.fetchOk.pipe(
Http.client.mapRequest(
Http.request.prependUrl(${config.VITE_APP_DEFAULT_URL}/api),
),
Http.client.mapRequest(Http.request.bearerToken(api.getToken() ?? "")),
);
const get = Http.request.get("").pipe(
client,
Http.response.json,
Effect.catchTags({
ResponseError: (err) => {
console.log({ error: err });
return Effect.fail(err)
},
}),
);
Is there any way to get the message that I receive from the backend?
{ "statusCode":400, "message":"Not allowed client scope \"united-admin-panel\"" }
Was this page helpful?