Replacing string error with Error error

Importing fix from PR #372.
Merge branch 'reorg-throw-error-not-string' into develop