cast err to an error
0.2.2