History

fix wasm

Rhys Sullivan committed 8 months ago

Commit cc270611 parent bcdff4d1 file · +7 −1Browse files

Unified · Split

packages/control-plane/src/runtime/source-discovery.ts+7−1
@@ -619,10 +619,12 @@ const tryDetectOpenApi = (input: { · 618 unmodified lines
619619 }));
620620
621621 if (response._tag === "Left") {
622+ console.warn(`[discovery] OpenAPI probe HTTP fetch failed for ${input.normalizedUrl}:`, response.left.message);
622623 return null;
623624 }
624625
625626 if (response.right.status < 200 || response.right.status >= 300) {
627+ console.warn(`[discovery] OpenAPI probe got status ${response.right.status} for ${input.normalizedUrl}`);
626628 return null;
627629 }
628630
@@ -630,6 +632,7 @@ const tryDetectOpenApi = (input: { · 1 unmodified line
630632 extractOpenApiManifest(input.normalizedUrl, response.right.text),
631633 );
632634 if (manifest._tag === "Left") {
635+ console.warn(`[discovery] OpenAPI manifest extraction failed for ${input.normalizedUrl}:`, manifest.left instanceof Error ? manifest.left.message : String(manifest.left));
633636 return null;
634637 }
635638
@@ -662,7 +665,10 @@ const tryDetectOpenApi = (input: { · 26 unmodified lines
662665 warnings: [],
663666 },
664667 } satisfies OpenApiProbeResult;
665− }).pipe(Effect.catchAll(() => Effect.succeed(null)));
668+ }).pipe(Effect.catchAll((error: unknown) => {
669+ console.warn(`[discovery] OpenAPI detection unexpected error for ${input.normalizedUrl}:`, error instanceof Error ? error.message : String(error));
670+ return Effect.succeed(null);
671+ }));
666672
667673 const looksLikeGraphqlEndpoint = (normalizedUrl: string): boolean =>
668674 /graphql/i.test(new URL(normalizedUrl).pathname);