There is no technical difference between the two ways of writing the branches in terms of what would happen. It's a matter of style and personal preference.
Some developers dislike having an unconditional exit in the
else branch of an if statement if the first branch is exiting.
I would probably write the code as
if [ "$ERROR_COUNT" -ne 0 ]; then
echo 'There were errors' >&2
# echo 'No errors' >&2
Note the removed semicolons, the quoted variable expansion, and the removed last
exit (which is implicit at the end of the script. I changed the test to
-ne 0 from
-gt 0 because it's clearer (at least to me).
I've also changed the output of the two diagnostic messages so that they go to the standard error stream (and improved them in a way that would be more useful to the user). It is debatable whether the last
echo should be there at all since there is really nothing to report other than successful execution (I commented it out).