avian2 / jsonmerge

Merge a series of JSON documents.
MIT License
214 stars 25 forks source link

more verbose HeadInstanceError: Id was not unique #32

Closed mmxmb closed 6 years ago

mmxmb commented 6 years ago

Make "HeadInstanceError: Id was not unique" less ambiguous. Without key_1 information it's hard to debug.

avian2 commented 6 years ago

Hi. Your pull request doesn't pass unit tests. Also, are you sure this is needed? The exceptions already show you the JSON path to the offending element.

mmxmb commented 6 years ago

@avian2

I am unsure why the build failed since I simply changed a print statement.

My problem with this exception was that it showed me the index of the first duplicate key. I don't have much experience with jsonmerge and that error message was not helpful at all since I didn't realize it's telling me the index. I had to change the print statement like I did in the push request to realize what was wrong. Just my two cents.

avian2 commented 6 years ago

I made the exception strings more descriptive and they now include the offending id.