Handle exceptions thrown when creating test commands