saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 114 forks source link

Improve chord build errors #62

Open gsouf opened 9 years ago

gsouf commented 9 years ago

Hi,

I have a work in progress where user can type their one chord, and this goes to the chord builder. It's very straightforward because the chord parser does the analysis of the user input for me.

My goal today it to display error to the user in his language. I could translate the error message that the library return, but it is definitively a bad solution (and moreover the error returned contains some variables).

I have though about 2 obvious way to fix it (and both can be implemented together).

obviously, we can mix both solution and throw different exception with translated message.

saebekassebil commented 9 years ago

Hi @SneakyBobito,

We should definitely go for option 2. We could do this by returning/throwing an error with a constant error symbol.

I'll look into this, if you don't want to?

gsouf commented 9 years ago

I can do it for sure. Just give me a few time.