@@ -4,7 +4,7 @@ import { createPortal } from "react-dom";
44import { useTooltip } from "@lib/hooks/useTooltip" ;
55import { ErrorBoundaryProvider } from "@lib/wrappers/ErrorBoundary" ;
66import { clsx } from "@lib/utils/clsx" ;
7- import { ENoIntegrationError , EShadowError } from "@lib/utils/error" ;
7+ import { EError , ENoIntegrationError , EShadowError } from "@lib/utils/error" ;
88import { DevPodLogoIcon } from "@src/icons/devpod" ;
99import { StrictMode } from "react" ;
1010import { ButtonLink } from "@lib/components/Button" ;
@@ -28,19 +28,18 @@ function getDevPodUrl() {
2828 branch = integration . getBranch ( { url, document } ) ;
2929 } catch ( error ) {
3030 if (
31- error instanceof EIntegrationParseError &&
32- error . data ?. cause === "no match"
31+ // "no match" errors are expected when we're on the main branch
32+ ! ( error instanceof EIntegrationParseError ) ||
33+ error . data ?. cause !== "no match"
3334 ) {
34- // We're just not on any branch, that's fine. DevPod will automatically check out the default branch.
35- } else {
3635 throw error ;
3736 }
3837 }
3938
4039 const branchSuffix = branch ? `@${ branch } ` : "" ;
4140 return `https://devpod.sh/open#https://github.com/${ repo } ${ branchSuffix } ` ;
4241 } catch ( error ) {
43- console . error ( error ) ;
42+ console . error ( EError . serialize ( error ) ) ;
4443 throw error ;
4544 }
4645}
@@ -131,7 +130,10 @@ function init(attempts: number = 0) {
131130 if ( error instanceof ENoIntegrationError ) {
132131 // Ignore, expected error when the site is not supported.
133132 } else {
134- console . info ( "Initialization failed" , { attempts, error } ) ;
133+ console . info ( "Initialization failed" , {
134+ attempts,
135+ error : EError . serialize ( error ) ,
136+ } ) ;
135137 }
136138 // 10ms, 20ms, 40ms, 80ms, 160ms, 320ms, 640ms, 1280ms, 2560ms, 5120ms, 10240ms, 20480ms
137139 setTimeout ( ( ) => init ( attempts + 1 ) , Math . pow ( 2 , attempts ) * 10 ) ;
0 commit comments