apparently err is just a string nowadays...
Tweak error handling to accept both raw strings and errcodes.
Merge branch 'master' into develop