If there is no errors, the data will not be routed to the error view.
I assume that the “Ignore empty stream” checkbox is not checked, which means that an empty array will be written at the output view if there is no documents on the input(like in your case).
So always when you run the pipe, you will get empty error file, even if there is no error.
To resolve that you should check the “Ignore empty stream” checkbox in the JSON Formatter snap.
You can also check the SnapLogic documentation for the JSON Formatter Snap.