Skip to content

Commit

Permalink
chore(cli): error output
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed May 8, 2018
1 parent 6a69a67 commit 37735db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/packages/prisma-cli-core/src/utils/EndpointDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ export class EndpointDialog {
) {
const { numTables, sdl } = await introspector.introspect(schemas[0])
if (numTables === 0) {
throw new Error(
`The provided database doesn't contain any tables. Please either provide another database or choose "No" for "Does your database contain existing data?"`,
this.out.log(
chalk.red(
`\n${chalk.bold(
'Error: ',
)}The provided database doesn't contain any tables. Please either provide another database or choose "No" for "Does your database contain existing data?"`,
),
)
this.out.exit(1)
}
this.out.log(
`Created datamodel definition based on ${numTables} database tables.`,
Expand Down

0 comments on commit 37735db

Please sign in to comment.