Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error contains un-typed properties #11510

Open
2 of 7 tasks
HopefulLlama opened this issue Oct 4, 2019 · 1 comment
Open
2 of 7 tasks

Error contains un-typed properties #11510

HopefulLlama opened this issue Oct 4, 2019 · 1 comment
Labels
type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Comments

@HopefulLlama
Copy link

HopefulLlama commented Oct 4, 2019

Issue Description

What are you doing?

Attempting to access .parent.detail property of an error.

const errorMessage = error.parent.detail;

What do you expect to happen?

I wanted to get this property without any Type errors from TypeScript!

What is actually happening?

The output was that TypeScript complains about missing properties, and that I needed to amend the code (losing type safety) as such!

const errorMessage = (error as any).parent.detail;

Additional context

Add any other context or screenshots about the feature request here.

Environment

  • Sequelize version: 5.18.4
  • Node.js version: 12.9.1
  • Operating System: MacOS Sierra
  • If TypeScript related: TypeScript version: 3.6.3

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@papb papb added status: awaiting investigation type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. labels Oct 4, 2019
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2021

This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.
Projects
None yet
Development

No branches or pull requests

4 participants