glu-free error handling alternative