Remove error raw strings from main code, and create custom `error` type. Also rename `context` to make the code more understandable.