lib: define recover types for errors