better error handler for defineOption()