File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 99import {
1010 Capability ,
1111 EventDirection ,
12+ IMatrixApiError as IWidgetMatrixError ,
1213 IOpenIDCredentials ,
1314 IOpenIDUpdate ,
1415 ISendDelayedEventDetails ,
@@ -33,6 +34,7 @@ import {
3334 ITurnServer as IClientTurnServer ,
3435 EventType ,
3536 IContent ,
37+ MatrixError ,
3638 MatrixEvent ,
3739 Room ,
3840 Direction ,
@@ -689,4 +691,15 @@ export class StopGapWidgetDriver extends WidgetDriver {
689691 const blob = await response . blob ( ) ;
690692 return { file : blob } ;
691693 }
694+
695+ /**
696+ * Expresses a {@link MatrixError} as a {@link IWidgetMatrixError}
697+ * for use by Widget API error responses.
698+ * @param error The error to handle.
699+ * @returns The error expressed as a {@link IWidgetMatrixError},
700+ * or undefined if it is not a {@link MatrixError}.
701+ */
702+ public processError ( error : unknown ) : IWidgetMatrixError | undefined {
703+ return error instanceof MatrixError ? error . asWidgetApiErrorData ( ) : undefined ;
704+ }
692705}
You can’t perform that action at this time.
0 commit comments