Error handling for terminal calls