private function codeToMessage($code) {
        // get the error message belong to the given code
        switch ($code) {
            case \Th\FileDownloader::FILE_WRONG_MIME:
                $message = "File is of the wrong MIME type";
                break;
            case \Th\FileDownloader::FILE_WRONG_EXTENSION:
                $message = "File is of the wrong extension";
                break;
            case \Th\FileDownloader::INVALID_DOWNLOAD_DIR:
                $message = "User set download directory does not exist";
                break;
            default:
                $message = "Unknown download error";
                break;
        }

        // done, return the error message
        return $message;
    }
private function codeToMessage($code) {
        // get the error message belong to the given code
        switch ($code) {
            case \Th\FileDownloader::FILE_WRONG_MIME:
                $message = "File is of the wrong MIME type";
                break;
            case \Th\FileDownloader::FILE_WRONG_EXTENSION:
                $message = "File is of the wrong extension";
                break;
            case \Th\FileDownloader::INVALID_DOWNLOAD_DIR:
                $message = "User set download directory does not exist";
                break;
            default:
                $message = "Unknown download error";
                break;
        }

        // done, return the error message
        return $message;
    }
private function codeToMessage ( $ code ) { // get the error message belong to the given code switch ( $ code ) { case \ Th \ FileDownloader :: FILE_WRONG_MIME : $ message = "File is of the wrong MIME type" ; break ; case \ Th \ FileDownloader :: FILE_WRONG_EXTENSION : $ message = "File is of the wrong extension" ; break ; case \ Th \ FileDownloader :: INVALID_DOWNLOAD_DIR : $ message = "User set download directory does not exist" ; break ; default : $ message = "Unknown download error" ; break ; } // done, return the error message return $ message ; }
Method that switches the error code constants till it finds the messages
that belongs to the error code and then returns the message.

@param   int                 The error code
@return  string              The error message
Method that switches the error code constants till it finds the messages that belongs to the error code and then returns the message .