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

Make conversion error clearer and less detailed. #556

Merged
merged 1 commit into from
Nov 23, 2018
Merged

Make conversion error clearer and less detailed. #556

merged 1 commit into from
Nov 23, 2018

Conversation

kuba--
Copy link
Contributor

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

Signed-off-by: kuba-- kuba@sourced.tech
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
Signed-off-by: kuba-- <kuba@sourced.tech>
@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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy