Error handling and debugging techniques