We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c31e38 commit 53b3786Copy full SHA for 53b3786
src/useDocHandle.ts
@@ -38,10 +38,14 @@ export default function useDocHandle<T>(
38
if (options?.["~skipInitialValue"]) return undefined
39
const unwrappedURL = access(url)
40
if (!unwrappedURL) return undefined
41
- const parsedURL = parseAutomergeUrl(unwrappedURL)
42
- const existingHandle = repo.handles[parsedURL.documentId]
43
- if (existingHandle?.isReady()) {
44
- return existingHandle as DocHandle<T>
+ try {
+ const parsedURL = parseAutomergeUrl(unwrappedURL)
+ const existingHandle = repo.handles[parsedURL.documentId]
+ if (existingHandle?.isReady()) {
45
+ return existingHandle as DocHandle<T>
46
+ }
47
+ } catch (error) {
48
+ console.error("Error parsing URL:", error)
49
}
50
51
0 commit comments