Search Results

Search found 36003 results on 1441 pages for 'try catch'.

Page 11/1441 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How can I print the argument value that caused Exception in Java?

    - by Sanoj
    I am writing a parser for csv-files, and sometimes I get NumberFormatException. Is there an easy way to print the argument value that caused the exception? For the moment do I have many try-catch blocks that look like this: String ean; String price; try { builder.ean(Long.parseLong(ean)); } catch (NumberFormatException e) { System.out.println("EAN: " + ean); e.printStackTrace(); } try { builder.price(new BigDecimal(price)); } catch (NumberFormatException e) { System.out.println("Price: " + price); e.printStackTrace(); } I would like to be able to write something like: try { builder.ean(Long.parseLong(ean)); } catch (NumberFormatException e) { e.printMethod(); // Long.parseLong() e.printArgument(); // should print the string ean "99013241.23" e.printStackTrace(); } Is there any way that I at least can improve my code? And do this kind of printing/logging more programmatically?

    Read the article

  • Single ErrorDocument directive to catch all errors (.htaccess)

    - by Mike Valeriano
    Hello. Is there something like a wildcard directive to catch all possible errors and deal with them in a single custom error page? ErrorDocument 404 /error.php?code=404 ErrorDocument 403 /error.php?code=403 ... ErrorDocument NNN /error.php?code=NNN #possible use of RegExp? I know I probably won't be dealing with a lot of custom error pages here, but I'm curious about this.

    Read the article

  • Windows Media Center says "Searching for tuners" when I try to play live TV

    - by Louis
    After upgrading from Windows 8 Pro with Media Center to the 8.1 preview, I need some help in being able to watch live TV again. When I try to now, it says Please Wait. Searching for tuners. I tried reinstalling the software for the Hauppauge WinTV DCR-2650 TV tuner, and upgrading the firmware for both the tuner and the Cisco STA-1520 tuning adapter. I also tried swapping around the USB ports, cold-booting the devices, and running the Set Up TV Signal setting in WMC, but that says The TV signal cannot be configured because a TV tuner was not detected. Both devices look fine in Device Manager, reporting the "This device is working properly" status. I'm not sure if this is related, but I did have some network connectivity issues immediately after upgrading to Windows 8.1 where my either my subnet mask or default gateway was missing, and since the TV tuner shows up as a network device, I wonder if that might be related. However, I really don't know how those settings should look and Hyper-V sort of further complicates things with the virtual Ethernet adapters:

    Read the article

  • Catch Exception only in release

    - by Cicik
    HI, I have one global generic exception handler(catch ex as Exception) for all unhandled exceptions from application. But in debug mode(app runs from VS) I don`t want that exceptions go to this global handler. Better for me is when VS stops app on place when exception occurs. How can I do this, or is there some better approach for this? thanks

    Read the article

  • Lemonldap::ng + OpenID error in try generate

    - by spy86
    I am trying to configure authentication by OpenID in lemonldap::ng with this When I try http://auth.example.com/openidserver/username, I see following error: Unable to load Net::OpenID::Server Base class package "Net::OpenID::Server" is empty. (Perhaps you need to 'use' the module which defines that package first, or make that module available in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd). at /usr/share/perl5/vendor_perl/Lemonldap/NG/Portal/OpenID/Server.pm line 9 BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Lemonldap/NG/Portal/OpenID/Server.pm line 9, line 522. Compilation failed in require at /usr/share/perl5/vendor_perl/Lemonldap/NG/Portal/IssuerDBOpenID.pm line 40, line 522. LemonLDAP::NG Lemonldap::ng works in CentOS 6.4 and server have all update's

    Read the article

  • webmin bind issue- error when i try to start bind

    - by Arvind
    I am setting up a domain = mydomain.com with 2 nameservers ns1.mydomain.com and ns2.mydomain.com in Webmin - BIND. For this, I have registered 2 child nameservers at my domain registrar, and in Webmin-Bind I have set up a new zone for this domain. In this zone, i have specified 2 nameserver records- one each for ns1 and ns2. Also, I have defined 2 address records- one each for ns1.mydomain.com -> IP Address #1 and for ns2.mydomain.com -> IP Address #2 However when I try to start BIND in Webmin, I get the following error-- Failed to start BIND : Starting named: Error in named configuration: zone mydomain.com/IN: has no NS records zone mydomain.com/IN: not loaded due to errors. _default/mydomain.com/IN: bad zone [FAILED]

    Read the article

  • Ubuntu Deluge shows errors when downloading large bit torrent files and keeps erroring out after try

    - by MikeN
    Ubuntu Deluge shows errors when downloading large bit torrent files and keeps erroring out after trying to resume. The error on details shows: "Invalid argument". This happens for many large torrents that are running for several days (trying to download.) I try to "resume" and "force rechceck" but it never works. Smaller torrents seem to work ok. What is causing these torrents to never complete? Is there a way to force Deluge to keep auto-resuming every few minutes after a failure instead of just giving up?

    Read the article

  • Graphics card failure, anything I could try...

    - by ILMV
    My gaming PC has decided to die, it's not the first time but usually a quick ATX reset brings it back to life. Today it didn't. I disconnect all unessasary devices so I've only got the case button / LED cables, GPU, CPU, RAM and power connected, the computer still didn't turn on. I've not got a speaker on my motherboard so found a spare one I have for testing and when the machine starts up I get one long beep and two short beeps from my Award BIOS, which apparently means a video card error. I change it with the GPU from another machine and all works well. Q: So I have a faulty graphics card (an nVidia 8800GT OC), is there anything I can try to resurect it?

    Read the article

  • XenServer 6.2 crashes everytime I try to install a new Windows 7 x64 vm

    - by Erik
    I'm running XenServer 6.2 with all patches and updates on two boxes. One box is an intel core i7 2600K.. works great. My latest box is an AMD A10 APU.. and everytime I try to install Windows 7 OS as a guest.. I get to the screen where Windows files start to expand, and suddenly the entire box freezes up. Is there a log I can check, and or a way to migrate a working Windows 7 image I created on Box 1 over to Box 2?

    Read the article

  • Is it possible to programatically catch JavaScript SyntaxErrors?

    - by Matty
    I don't think that this is doable, but wanted to throw it out to the community to confirm my suspicions. Let's say you're writing a program in another language like Python, PHP, or ASP. This program is intended to build another program written in JavaScript. However, the first program is unfortunately not immune to errors. So, occasionally, the program which builds the JavaScript program does some funky stuff and outputs a syntax error in the JavaScript source. Now some user goes and loads the program and it essentially halts, because the web browser running it can't properly parse the JavaScript. This user is probably not going to be happy. I wouldn't be. This brings me to my question. Is it possible to write an error handler that would catch these kind of syntax problems allowing the application to fail gracefully? Here's an example: <html> <head> <script type="text/javascript" charset="utf-8"> window.onerror = errorHandler; function errorHandler(a,b,c) { alert('horray! No wait, Booo!'); } vara jfs; </script> </head> <body> Can this be done? </body> </html> or <html> <head> <script type="text/javascript" charset="utf-8"> try { vara jfs; } catch (e) { alert('horray! No wait, Booo!'); } </script> </head> <body> Can this be done? </body> </html>

    Read the article

  • Try exchange in real domain

    - by AndreaCi
    We (as a company) 'd like to try exchange server to replace our mail server. I downloaded the demo version from Microsoft website, but during the installation it wants administrator access to domain to edit the Active Directory database structure. The test will last for (at least) a month to see if it will bring real advantages to our management systems. Here is my question: Is it "dangerous"? If I uninstall the exchange server everything will be reverted to previous state? I'm kind of "scared" about the changes he may apply to our domain controllers.

    Read the article

  • Java Date exception handling try catch

    - by user69514
    Is there some sort of exception in Java to catch an invalid Date object? I'm trying to use it in the following method, but I don't know what type of exception to look for. Is it a ParseException. public boolean setDate(Date date) { this.date = date; return true; }

    Read the article

  • How to catch GMail auto-refresh

    - by nameanyone
    I wrote a userscript to highlight the current row in GMail (indicated by the arrow). Unfortunately the highlight will only stay until GMail Inbox is auto-refreshed, which happens quite often. Is there a way to catch that event so I could reapply the highlighting? I don't want to do it on timeout. There is another userscript that does that and it loads up CPU.

    Read the article

  • Try-Catch equivalent in Objective-C / xcode

    - by IIS7 Rewrite
    I get an app crash in main.m in my app and have no idea why the error is happening because xcode doesn't show me where the crash occurs, it shows me that it crashes at return UIApplicationMain(argc, argv ...) which tells me nothing. Is there a way to have in xcode / Objective-C the equivalent of a try/catch in Visual Studio to see exactly where the error is occuring? I'm using latest xcode (4.6 I believe). Thanks in advance.

    Read the article

  • Visual Studio 2008 crashes whenever I try to add a file to TFS

    - by Herms
    Wondering if anyone else has seen this or knows of a way to fix it. I have Visual Studio 2008 Pro with Team Explorer 2008 installed. Starting a couple of weeks ago any time I try to add a file to TFS (using the "Add Items to Folder" button in the Source Control Explorer window) VS crashes. I briefly see an "unhandled exception" dialog appear, but VS quits right after the dialog opens. I was able to see the exception at one point, and it looked like an index out of bounds exception trying to access some UI component list at -1 (can't remember the specifics, and it closes before I can bring it up now). I've tried uninstalling and reinstalling VS a couple of times already, along with resetting all of my settings. Neither helped.

    Read the article

  • How to show why "try" failed in python

    - by calccrypto
    is there anyway to show why a "try" failed, and skipped to "except", without writing out all the possible errors by hand, and without ending the program? example: try: 1/0 except: someway to show "Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> 1/0 ZeroDivisionError: integer division or modulo by zero" i dont want to doif:print error 1, elif: print error 2, elif: etc.... i want to see the error that would be shown had try not been there

    Read the article

  • Java io ugly try-finally block

    - by Tom Brito
    Is there a not so ugly way of treat the close() exception to close both streams then: InputStream in = new FileInputStream(inputFileName); OutputStream out = new FileOutputStream(outputFileName); try { copy(in, out); } finally { try { in.close(); } catch (Exception e) { try { // event if in.close fails, need to close the out out.close(); } catch (Exception e2) {} throw e; // and throw the 'in' exception } out.close(); }

    Read the article

  • Scala: Can't catch exception thrown inside a closure

    - by Dmitriy
    Disclaimer: absolute novice in Scala :( I have the following defined: def tryAndReport(body: Unit) : Unit = { try { body } catch { case e: MySpecificException => doSomethingUseful } } I call it like this: tryAndReport{ someCodeThatThrowsMySpecificException() } While the call to someCodeThatThrowsMySpecificException happens just fine, the exception is not being caught in tryAndReport. Why? Thank you!

    Read the article

  • php crashes when I try to add extensions

    - by Christy
    Hi all, I am trying to install phpmyadmin on my web server with Windows 2008 and iis 7. PHP is running fine and I have several sites that rely on it. When installing phpmyadmin - it has errors at the bottom that crypt and mbstring are not properly installed. When I try to add the php_mcrypt.dll and/or the php_mbstring.dll to the php.ini file (I verified the location and the right file through phpinfo) it crashes. I get a 500 error on all the websites, and I get an error on the server saying FastCGI has failed. Does anyone know how to fix this or why it is happening? Shouldn't I be able to add extenstions? I have the dll files in the extension folder, which is referenced in the php.ini and other extensions (installed previously) are working as expected. Other info: php version 5.2.8, pdo driver for mysql version 5.0.51a Thanks in advance!

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >