throw

    0熱度

    1回答

    上拋出SOAP錯誤我開發使用SOAP庫NodeJ的SOAP服務器 S(v6.9.4)。我必須從Postgres數據庫請求一些數據。我選擇使用lib。 SAOP服務實現這樣的: TestConnection: function (args, cb, headers, req) { db.any("select * from users where active=$1", [true])

    -2熱度

    1回答

    最後更新:感謝您的所有意見和幫助。我回到教科書並複製整個代碼來運行他們的程序,並且意識到他們的投擲消息從未出現過,我假設那裏會出現消息,這就是爲什麼我期待在我的程序中出現一條消息,這就是爲什麼我沒有使用try/catch。再次感謝您幫助球員/女球員。 我正在進行作業,並且由於某種原因,throw invalid_argument不會顯示消息「帳戶餘額過低」。 我幾乎把代碼從我的課本 void se

    0熱度

    1回答

    當我嘗試輸入登錄名時,程序正在向我發送段&寫一些關於不正確的synxtax錯誤'='的信息。 public bool personelEntryControl(string password, int UserId) { bool result = false; SqlConnection con = new SqlConnection(gnl.conString);

    2熱度

    1回答

    我想實現一個新的異常,我們的代碼庫和我在SO跨越此帖一: https://stackoverflow.com/a/8152888/654019 ,但我不知道爲什麼什麼方法定義如下: virtual const char* what() const throw(){ return msg_.c_str(); } throw在這種情況下的含義是什麼?

    10熱度

    3回答

    我有一個Exception類,在我扔它之前我想設置更多的信息。我可以創建Exception對象,調用它的一些函數,然後丟棄它的任何副本嗎? 我發現的唯一方法是拋出一個指向對象: class Exception : public std::runtime_error { public: Exception(const std::string& msg) : std::runtime_e

    4熱度

    2回答

    我已經看到了一些代碼,最近在這裏筆者被扔了幾乎每一個構造異常和拋出運行時異常的東西像下面的代碼,在一個返回int的方法: if(condition){ return 1; } if(condition){ return 2; } if(condition){ return 3; } throw new RuntimeException("Unreachab

    -1熱度

    1回答

    這裏的初學程序員在Visual Studio中工作。 vector<string> fileParse(vector<string> & inputStrings, string & fileName) { ifstream x; x.open(fileName); cout << "attempting to open file" << endl; if

    0熱度

    2回答

    如何將語法文件中的自定義錯誤消息拋出到java類(解析和lexing被定義的地方)? < ----------解析器語法-----------> parser grammar EParser; @members { public void displayRecognitionError(String[] tokenNames, RecognitionException e) {

    2熱度

    1回答

    當我跨過斷點在我的代碼我也遇到過調試的奇怪的行爲: public async Task DoSomeWork() { await Task.Run(() => { Thread.Sleep(1000); }); var test = false; if (test) { throw new Exception("Im in IF body!

    0熱度

    4回答

    我正在進行一些驗證。有一些必填字段,其中一些是可選的。對於必填字段,我拋出異常,但對於可選字段,我必須打印警告,並且必須在我的方法中繼續。我沒有辦法做警告部分。有人可以幫忙嗎? public void method(String param1, String param2){ if(param1 == null){ throw new IllegalArgumentException(