Better error handling

Precise error handling is useful for informing users about exact problem.