Changed how errors are handled.

instead of `exports.logError( error )` it throws an error `throw new Error( messege )`.