Commit 6f082ef
committed
feature #150 Add a 'Did you mean ...' error message in case of an unrecognized API property (Lyrkan)
This PR was squashed before being merged into the master branch (closes #150).
Discussion
----------
Add a 'Did you mean ...' error message in case of an unrecognized API property
This PR aims to improve the error message displayed when an user makes a typo in the name of one of the API methods he's trying to use.
Since pictures speak louder than words:
**Before**

**After**

Note that the error is triggered when trying to access the property, not when the method is called (since it doesn't exist), hence the "is not a recognized property" message. I'm aware that the use of the "property" word in it may not be ideal, but using "method" instead feels wrong too since we could theoretically have other things than methods in the API object.
Commits
-------
a16e1af Only add the "Did you mean" message if the levenshtein distance is less than 3
1ceabc1 Add "or method" to the "Did you mean ..." error message
d592481 Add a 'Did you mean ...' error message for unrecognized API methods3 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
777 | 779 | | |
778 | 780 | | |
779 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
780 | 804 | | |
781 | 805 | | |
782 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2162 | 2162 | | |
2163 | 2163 | | |
2164 | 2164 | | |
2165 | | - | |
| 2165 | + | |
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
| |||
0 commit comments