move the error exception to the public library project and return error
code