Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Conversation

@kuba--
Copy link
Contributor

@kuba-- kuba-- commented Nov 21, 2018

Signed-off-by: kuba-- [email protected]
Closes src-d/gitbase#615

@kuba-- kuba-- requested a review from a team November 21, 2018 11:00
@kuba-- kuba-- added the proposal proposal for new additions or changes label Nov 21, 2018
@kuba-- kuba-- changed the title Make convertion error clearer and less detailed. Make conversion error clearer and less detailed. Nov 21, 2018
@jfontan
Copy link
Contributor

jfontan commented Nov 21, 2018

It would be nice to have the expression that fails to be casted but I suppose you don't have that information at that point.

@kuba--
Copy link
Contributor Author

kuba-- commented Nov 21, 2018

I have it on the higher level, but not here. On the other hand on the higher level it's hard to figure out what is the error, because it comes from spf13/cast. Unfortunately in this package error handling is not done very well - errors are either hardcoded/formatted strings or private vars. That's why here:

if err.Error() == "unable to cast negative value" {

we have to do this ugly thing!

@ajnavarro ajnavarro merged commit 1cffdc1 into src-d:master Nov 23, 2018
@kuba-- kuba-- deleted the err-msg branch November 23, 2018 10:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

proposal proposal for new additions or changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants