Hello all, I have a question about the npm packag...
# talk-kratos
c
Hello all, I have a question about the npm package @ory/kratos-client (v 0.13.1). I use it in my Angular project for the settings flow. But now I am wondering how to react on errors. Because I get a "RequiredError" in the catch block here which only gets a stackstrace. But the "GenericError" object (from the API doc) I am looking for. However I need the GenericError object to respond to the different errors e.g. "session_refresh_required". How do i get this object in case of error using ory library. My code snippet:
Copy code
this.kratosApi.updateSettingsFlow({
    flow: this.flow.id,
    updateSettingsFlowBody: {
        flow: this.flow.id,
        method: 'profile',
        csrf_token: tokenGroup.attributes.value,
        traits: {
            email: "<mailto:max@test.de|max@test.de>",
            name: {
                first: "Max",
                last: "M",
            }
        }
    },
}).then((res) => {
  console.log(res)
}).catch((err) => {
  console.log(err)
})
Here is the console output of the Error object of an example error ( in this case "session_refresh_required")
Error: Request failed with status code 403
at createError (createError.js:16:15)
at settle (settle.js:17:12)
at XMLHttpRequest.onloadend [as __zone_symbol__ON_PROPERTYloadend] (xhr.js:54:7)
at XMLHttpRequest.wrapFn (zone.js:755:39)
at _ZoneDelegate.invokeTask (zone.js:402:31)
at core.mjs:25998:55
at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:25998:36)
at _ZoneDelegate.invokeTask (zone.js:401:60)
at Object.onInvokeTask (core.mjs:26308:33)
at _ZoneDelegate.invokeTask (zone.js:401:60)