working on error conversion for ErrorCode