Test error code in ON ERROR routine