@@ -50,6 +50,7 @@ import localStorageSet from "roamjs-components/util/localStorageSet";
5050import isLiveBlock from "roamjs-components/queries/isLiveBlock" ;
5151import createPage from "roamjs-components/writes/createPage" ;
5252import { createInitialTldrawProps } from "../utils/createInitialTldrawProps" ;
53+ import sendErrorEmail from "../utils/sendErrorEmail" ;
5354
5455const ExportProgress = ( { id } : { id : string } ) => {
5556 const [ progress , setProgress ] = useState ( 0 ) ;
@@ -447,26 +448,14 @@ const ExportDialog: ExportDialogComponent = ({
447448 } catch ( e ) {
448449 const error = e as Error ;
449450 renderToast ( {
450- content : "Looks like there was an error. The team has been notified. " ,
451+ content : "Looks like there was an error." ,
451452 intent : "danger" ,
452453 id : "query-builder-error" ,
453454 } ) ;
454- apiPost ( {
455- domain : "https://api.samepage.network" ,
456- path : "errors" ,
457- data : {
458- method : "extension-error" ,
459- type : "Query Builder Export Dialog Failed" ,
460- message : error . message ,
461- stack : error . stack ,
462- version : process . env . VERSION ,
463- notebookUuid : JSON . stringify ( {
464- owner : "RoamJS" ,
465- app : "query-builder" ,
466- workspace : window . roamAlphaAPI . graph . name ,
467- } ) ,
468- } ,
469- } ) . catch ( ( ) => { } ) ;
455+ sendErrorEmail ( {
456+ error,
457+ type : "Query Builder Export Dialog Failed" ,
458+ } ) ;
470459 } finally {
471460 setLoading ( false ) ;
472461 onClose ( ) ;
@@ -719,28 +708,16 @@ const ExportDialog: ExportDialogComponent = ({
719708 }
720709 } catch ( e ) {
721710 const error = e as Error ;
722- apiPost ( {
723- domain : "https://api.samepage.network " ,
724- path : "errors" ,
711+ sendErrorEmail ( {
712+ type : "Query Builder Export Dialog Failed " ,
713+ error ,
725714 data : {
726- method : "extension-error" ,
727- type : "Query Builder Export Dialog Failed" ,
728- data : {
729- activeExportType,
730- filename,
731- results :
732- typeof results === "function" ? "dynamic" : results ,
733- } ,
734- message : error . message ,
735- stack : error . stack ,
736- version : process . env . VERSION ,
737- notebookUuid : JSON . stringify ( {
738- owner : "RoamJS" ,
739- app : "query-builder" ,
740- workspace : window . roamAlphaAPI . graph . name ,
741- } ) ,
715+ activeExportType,
716+ filename,
717+ results :
718+ typeof results === "function" ? "dynamic" : results ,
742719 } ,
743- } ) . catch ( ( ) => { } ) ;
720+ } ) ;
744721 setDialogOpen ( true ) ;
745722 setError ( ( e as Error ) . message ) ;
746723 } finally {
0 commit comments