Skip to content

Commit

Permalink
fix: improve no telefunc file found error
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Feb 15, 2022
1 parent e0a5987 commit 51fff0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion telefunc/node/server/runTelefunc/loadTelefuncFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { loadTelefuncFiles }

import type { ViteDevServer } from 'vite'
import type { TelefuncFiles } from '../types'
import { assertUsage } from '../../utils'
import { assert, assertUsage } from '../../utils'
import { loadTelefuncFilesWithVite } from '../../vite/loadTelefuncFilesWithVite'
import { loadTelefuncFilesWithInternalMechanism } from './loadTelefuncFilesWithInternalMechanism'

Expand All @@ -18,6 +18,7 @@ async function loadTelefuncFiles(runContext: {
{
const telefuncFiles = loadTelefuncFilesWithInternalMechanism()
if (telefuncFiles) {
assert(Object.keys(telefuncFiles).length > 0, 'Internal Mechanism: No `.telefunc.js` file found.')
return telefuncFiles
}
}
Expand All @@ -28,6 +29,7 @@ async function loadTelefuncFiles(runContext: {
{
const telefuncFiles = loadTelefuncFilesWithVite(runContext)
if (telefuncFiles) {
assert(Object.keys(telefuncFiles).length > 0, 'Vite: No `.telefunc.js` file found.')
return telefuncFiles
}
}
Expand Down

0 comments on commit 51fff0a

Please sign in to comment.