Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

schema validation errors should not trigger an error reporting #571

Closed
Jolg42 opened this issue Aug 27, 2020 · 2 comments · Fixed by prisma/prisma#3450
Closed

schema validation errors should not trigger an error reporting #571

Jolg42 opened this issue Aug 27, 2020 · 2 comments · Fixed by prisma/prisma#3450
Assignees
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Aug 27, 2020

Bug description

This triggers the reporting error but it should not.

How to reproduce

  • Run npx @prisma/cli@dev migrate save --name init --experimental

Screen Shot 2020-08-27 at 16 29 20

Expected behavior

A Schema parsing / validation error (with a code) that doesn't trigger an error report.

Prisma information

datasource my_db {
  provider = "sqlite"
  url      = "file:dev7.db"
}

model Blog {
  id          Int @id
  viewCount20 Intss
}

@tomhoule I guess this could be fixed if the error(s) have an error code.

@Jolg42 Jolg42 added kind/improvement An improvement to existing feature and code. tech/engines Issue for tech Engines. labels Aug 27, 2020
@Jolg42 Jolg42 added this to the Backlog 2.6.0 milestone Aug 27, 2020
@janpio janpio added the process/candidate Candidate for next Milestone. label Aug 27, 2020
@tomhoule
Copy link
Contributor

I think they already do (it should be a known error with an error code already). I can double check after my vacation.

@Jolg42
Copy link
Member Author

Jolg42 commented Aug 28, 2020

Indeed I will fix that in client then!

  MigrateEngine:rpc {
  MigrateEngine:rpc   jsonrpc: '2.0',
  MigrateEngine:rpc   error: {
  MigrateEngine:rpc     code: 4466,
  MigrateEngine:rpc     message: 'An error happened. Check the data field for details.',
  MigrateEngine:rpc     data: {
  MigrateEngine:rpc       is_panic: false,
  MigrateEngine:rpc       message: 'error: Type "Intss" is neither a built-in type, nor refers to another model, custom type, or enum.\n' +
  MigrateEngine:rpc         '  -->  schema.prisma:8\n' +
  MigrateEngine:rpc         '   | \n' +
  MigrateEngine:rpc         ' 7 |   id          Int @id\n' +
  MigrateEngine:rpc         ' 8 |   viewCount20 Intss\n' +
  MigrateEngine:rpc         '   | \n',
  MigrateEngine:rpc       meta: [Object],
  MigrateEngine:rpc       error_code: 'P1012'
  MigrateEngine:rpc     }
  MigrateEngine:rpc   },
  MigrateEngine:rpc   id: 2
  MigrateEngine:rpc } +20ms

@Jolg42 Jolg42 added tech/typescript Issue for tech TypeScript. and removed process/candidate Candidate for next Milestone. tech/engines Issue for tech Engines. labels Aug 28, 2020
@Jolg42 Jolg42 assigned Jolg42 and unassigned tomhoule Aug 28, 2020
@Jolg42 Jolg42 modified the milestones: Backlog 2.6.0, Release 2.6.0 Aug 28, 2020
Jolg42 added a commit to prisma/prisma that referenced this issue Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants