question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad error reporting on create type

See original GitHub issue
CREATE TYPE MyStr EXTENDING str;                                     
ERROR: InternalServerError: 'NoneType' object has no attribute 'is_schema_field'

Version 1.0-alpha.2+dev.391.g2276144b

I obviously needed CREATE SCALAR TYPE and would expect it to be grammar error (i.e. something like TYPE is unexpected, expected one of SCALAR, DATABASE, ...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
elpranscommented, Dec 25, 2019

would expect it to be grammar error

CREATE TYPE is valid syntax and is used to define object types. The crash in this case is caused by the fact that you’re trying to create an object type that inherits from a scalar type. There has to be a check to prevent mixing schema object classes like that. Here and here are good spots to place the checks in (check bases).

0reactions
msullivancommented, Sep 3, 2021

It looks like we produce an error message now (instead of an ISE), but not a good one: ERROR: InvalidReferenceError: schema object UUID('00000000-0000-0000-0000-000000000101') exists, but is a 'scalar type' not a 'object type'

We can do better

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Report Errors in Forms: 10 Design Guidelines
How to Report Errors in Forms: 10 Design Guidelines · 1. Aim for Inline Validation Whenever Possible · 2. Indicate Successful Entry for...
Read more >
Error Messages: Examples, Best Practices & Common Mistakes
1. Write for humans (be understandable) · 2. Make sure the message is helpful · 3. Use a touch of humor · 4....
Read more >
Error handling - Apollo GraphQL Docs
Built-in error codes ; GRAPHQL_VALIDATION_FAILED. The GraphQL operation is not valid against the server's schema. ; BAD_USER_INPUT. The GraphQL operation includes ...
Read more >
PHP error reporting
Due to various historical reasons, there are thousands of bad practices in the area of error handling and reporting. As a result, the...
Read more >
The Art of the Error Message. How to write clear, helpful copy ...
When developers and designers craft clear, helpful error messages for an app, it keeps users ... How to write clear, helpful copy for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found