Skip to content

Commit

Permalink
Merge pull request #217 from ericanderson/mf/better-cli-erroring
Browse files Browse the repository at this point in the history
Better foundry-sdk-generator error handling
  • Loading branch information
mfedderly authored Jan 25, 2024
2 parents 4252b0e + 8c5b85c commit 408ef1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-taxis-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/foundry-sdk-generator": patch
---

Better error handling around server errors when getting ontology metadata
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ export class OntologyMetadataResolver {
ontology.apiName,
);

if ((ontologyFullMetadata as any).errorName != null) {
return Result.err([
`Unable to load the specified Ontology metadata.\n${
JSON.stringify(ontologyFullMetadata, null, 2)
}`,
]);
}

const linkTypes = new Map<string, Set<string>>();
const objectTypes = new Set(
entities.objectTypesApiNamesToLoad?.map(object => object.toLowerCase()),
Expand Down

0 comments on commit 408ef1c

Please sign in to comment.