-
I use
Is there any way to pass the stacktrace to the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@NLueg Can you help out? Do you have an idea? (He implemented this feature in #201). |
Beta Was this translation helpful? Give feedback.
-
Hey, this sounds like the feature that I proposed in #201 isn't used here. The mentioned issue is exactly the reason why I added the feature to include a JS stack trace. @lubbo you can use import { ErrorHandler, Injectable } from '@angular/core';
import { FirebaseCrashlytics } from "@capacitor-firebase/crashlytics";
import * as StackTrace from 'stacktrace-js';
@Injectable({ providedIn: 'root' })
export class ShowAlertOnError implements ErrorHandler {
async handleError(error: Error): Promise<void> {
StackTrace.fromError(error).then((stackTrace) => {
FirebaseCrashlytics.recordException({
message: error.message,
stacktrace: stackTrace,
});
});
}
} You need to have in mind, that you still see the minified stack trace as. the source maps shouldn't be included in the production build. But still this helps a lot in analysing upcoming issues. |
Beta Was this translation helpful? Give feedback.
Hey, this sounds like the feature that I proposed in #201 isn't used here. The mentioned issue is exactly the reason why I added the feature to include a JS stack trace. @lubbo you can use
stracktrace-js
to include the Stacktrace of an exception. By using this, every issue has its own group in the console. I use this error handler in my angular application: