Skip to content

Conversation

@hmil
Copy link
Contributor

@hmil hmil commented Mar 4, 2020

Enhance error messages by using the actual name of the checked symbol instead of just $ when possible.

Example:

@ValidateClass()
class MyClass {
    myMethod(@AssertType() make, @AssertType() model) { }
}

Before: validation failed at $: expected 'type' in object (Can't tell which parameter failed)
After: validation failed at model: expected 'type' in object (More useful)


This code is just a quick and dirty PoC. I can clean it up if you are open to this enhancement.

@woutervh-
Copy link
Owner

Hi @hmil ,

Thank you for your contribution. I think it's a great idea!

I'm happy to merge this PR. You mentioned you can clean it up. Let me know when you are finished with that, and then I will merge this :)

@hmil hmil force-pushed the identifier-names branch from 1830510 to db220f4 Compare March 7, 2020 01:20
@hmil
Copy link
Contributor Author

hmil commented Mar 9, 2020

It's all good on my side 👌

@woutervh-
Copy link
Owner

Awesome, thanks!

@woutervh- woutervh- merged commit e4adfbf into woutervh-:master Mar 13, 2020
@woutervh-
Copy link
Owner

Released as v0.15.0 https://github.com/woutervh-/typescript-is/releases/tag/v0.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants