mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
[PM-14180] Provide more debugging details in wasm-debug (#11771)
Improve error logging to include some additional information about the error.
This commit is contained in:
@@ -29,5 +29,5 @@ export abstract class SdkService {
|
||||
*/
|
||||
abstract userClient$(userId: UserId): Observable<BitwardenClient>;
|
||||
|
||||
abstract failedToInitialize(): Promise<void>;
|
||||
abstract failedToInitialize(category: string, error?: Error): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ export class DefaultSdkService implements SdkService {
|
||||
return client$;
|
||||
}
|
||||
|
||||
async failedToInitialize(): Promise<void> {
|
||||
async failedToInitialize(category: string, error?: Error): Promise<void> {
|
||||
// Only log on cloud instances
|
||||
if (
|
||||
this.platformUtilsService.isDev() ||
|
||||
@@ -139,9 +139,20 @@ export class DefaultSdkService implements SdkService {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.apiService.send("POST", "/wasm-debug", null, false, false, null, (headers) => {
|
||||
headers.append("SDK-Version", "1.0.0");
|
||||
});
|
||||
return this.apiService.send(
|
||||
"POST",
|
||||
"/wasm-debug",
|
||||
{
|
||||
category: category,
|
||||
error: error?.message,
|
||||
},
|
||||
false,
|
||||
false,
|
||||
null,
|
||||
(headers) => {
|
||||
headers.append("SDK-Version", "1.0.0");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
private async initializeClient(
|
||||
|
||||
Reference in New Issue
Block a user