* fix error message
    - change error to exception
    - define return codes
    - apply return codes.