Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions hooks/ide/use-compile-database.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,20 @@ export default function useCompileDatabase(

const parseKf = async (schema: string) => {
const res = await globalThis.parseKuneiform(schema)
// console.log(res)
console.log(res)
console.log({
...res,
json: res.json ? JSON.parse(res.json) : res.json
})
// TODO: Remove res.json !== "" once we are confident that unhandled errors are cleaned up in KF.
if (!res.json && res.json !== "") {
// if(!res.json) {
// if (!res.json && res.json !== "") {
if(!res.json) {
dispatch(
setAlert({
type: "error",
text: "Failed to parse database definition.",
text: "A parser error occured. Please check the console.",
}),
)
console.log('in failure block')
throw new Error(`Failed to parse database definition. Response: ${res.toString()}`)
}
return JSON.parse(res.json) as IParseRes
Expand Down