File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,15 @@ export const testCaptureException = mutation({
115115 } ,
116116} )
117117
118+ export const testThrowError = mutation ( {
119+ args : {
120+ errorMessage : v . string ( ) ,
121+ } ,
122+ handler : async ( _ctx , args ) => {
123+ throw new Error ( args . errorMessage )
124+ } ,
125+ } )
126+
118127// --- Feature flag methods (actions) ---
119128
120129const featureFlagArgs = {
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ function App() {
122122 const groupIdentifyM = useMutation ( api . example . testGroupIdentify )
123123 const aliasM = useMutation ( api . example . testAlias )
124124 const captureExceptionM = useMutation ( api . example . testCaptureException )
125+ const throwErrorM = useMutation ( api . example . testThrowError )
125126
126127 const agentManualA = useAction ( api . convexAgent . manualCapture . generate )
127128 const agentTracedA = useAction ( api . convexAgent . withTracing . generate )
@@ -431,6 +432,18 @@ function App() {
431432 >
432433 Capture Exception
433434 </ button >
435+ < button
436+ { ...btnProps ( 'throwError' ) }
437+ onClick = { ( ) =>
438+ run ( 'throwError' , ( ) =>
439+ throwErrorM ( {
440+ errorMessage : errorMsg ,
441+ } )
442+ )
443+ }
444+ >
445+ Throw Error
446+ </ button >
434447 </ div >
435448 </ Section >
436449
You can’t perform that action at this time.
0 commit comments