Commit dfdbd7f
committed
Catch panic when using go-spew
go-spew can panic when trying to diff certain types of values, there are
open issues about this on their GitHub repository.
go-spew is unfortunately unmaintained, we cannot expect a fix any time
soon. Also, because of go-spew's design, there are multiple causes for
a panic, and fixing all of them would be a huge undertaking.
We already return an empty diff when the types are not comparable, or
when the values are not from types that can be easily diffed by go-spew.
Let's hide the panic by recovering from it, and returning an empty diff
instead. This is not ideal, but at least it prevents the entire program from
crashing. The expected/actual values will still be printed, just without
the diff.1 parent 429ee0b commit dfdbd7f
2 files changed
+58
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1948 | 1948 | | |
1949 | 1949 | | |
1950 | 1950 | | |
1951 | | - | |
1952 | | - | |
1953 | | - | |
1954 | | - | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
1960 | | - | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
1961 | 1970 | | |
1962 | 1971 | | |
1963 | | - | |
| 1972 | + | |
1964 | 1973 | | |
1965 | 1974 | | |
1966 | 1975 | | |
| |||
1970 | 1979 | | |
1971 | 1980 | | |
1972 | 1981 | | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
1973 | 1987 | | |
1974 | 1988 | | |
1975 | 1989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
840 | 873 | | |
841 | 874 | | |
842 | 875 | | |
| |||
0 commit comments