How should I deal with exceptions?

I have three possible choices that I see:
(1) Deal with them in an exception handler class. Use try/catch/throw in the class. Have throw call a method in the exception handler class.
(2) Use try/catch/throw and handle the exception in the same class where the exception occurs.
(3) Use throws and deal with the exceptions in the mediator class. The mediator class allows for communication between my FileHandler class, my DBHandler class, my UIClass, and any future classes.
Note that for each exception, I want to call a method in the UI class that displays a message to the user about the error so it can be debugged and a method in some class to write the error to an error log text file.

Handling
can mean as little as logging the error.I'm gonna have to go ahead and disagree with youthere, %.
Disagree with me? This cannot be tolerated! 8)Watch it, lest yet get yer ass smote.
Except for where you're intentionally
smothering exceptions in finally blocks, or maybe
just recording an InterruptedException, justlogging
it is little better than smothering it. So what about unchecked exceptions? Are these .NET
demon spawn?I let unchecked exceptions bubble up. I'd expect an appserver to catch and log them, so that a bug in one app doesn't cause the whole server to barf. But other than that kind of situation, these are exceptions that you usually shouldn't try to handle.
>
I'm curious, since this thread is so much about
handling exceptions. What do people do besides
report them? If you get a SQL exception, what
recovery actions are you taking? Anything that I'm
missing?Usually it just bubbles up, or it's a wrapped in a more appropriate or layer-specific exception and rethrown. Sometimes there might be a retry, but usually the exception bubbles up to the higher layers and gets presented to the user as something like, "Could not connect. Retry?" What I hate to see is this:
try {
    // get stuff from the DB
catch (SQLExeption exc) {
    // log it
// Continue here (where "here" may be the calling method)
// with no idea that anything went wong.If you do that, you might as well not have an exception mechanism. Just go back to return codes and don't bother checking them.

Similar Messages

  • How should I deal with it in the BMM Layer

    Hi all,
    I need a suggestion in a problem.
    Here is the scenario,
    In the physical layer, There are some fact to fact joins.
    ProductFact ----< PolicyFact ----< PolicyCoverFact ----< ClaimFact ----< ClaimPaymentFact ----< CorrespondenceFact
    There are some conformed dimension tables given below
    Geography is joined to ProductFact, ClaimFact
    Organisation is joined to PolicyCoverFact, CorrespondenceFact
    Currency is joined to PolicyFact, ClaimPaymentFact
    Also there are non-conformed dimensions such as,
    ProductType is joined to ProductFact
    PolicyCoverType is joined to PolicyCoverFact
    and there are many more......What I know is when there are fact to fact joins, we should make a logical table in the BMM layer and add both fact tables to the same LTS, But in this case, almost all the fact tables are joined directly.
    How should I deal with these fact to fact joins in the BMM layer? Any suggestions?
    Edited by: LavaRider on Aug 25, 2010 2:47 AM

    LavaRider wrote:
    I have to create many LTS for the fact table......
    1 LTS for ProductFact
    1 LTS for ProductFact & PolicyFact (which contain ProductFact and PolicyFact as sources)
    1 LTS for ProductFact , PolicyFact & PolicyCoverFact ........
    and so on.....
    have I understood correctly? Is that what you mean?Yes, the reason why I said to "keep" the firsts fact table in each source is to make the dimension work.
    For example, if the "product dimension" is only linked to "product fact", but not "policy fact" then you won't be able to do a report based on "product dimension" and "policy fact". Right ? To be able to do this report, OBIEE must do a join with "product fact" (this fact table become an intersection table). That's why you will add product fact in the "policy fact" source. Same for others source.
    But the name of "ProductFact & PolicyFact" source can be "policy fact". Because each row of this source is a policy fact.
    For the 3rd table, each row is a "policy cover fact". But to be able to join with "product dimension" and "policy dimension", you need to integrate "policy fact" and "product fact" tables in the logical source.
    and so on.

  • How should I deal with FTP permissions?

    Ok, I'm not sure what would be the best way to deal with this. I have folders set up for several websites that each have a different user that administrates them. So I set each of the intended users home to the website root, and gave them ownership of the folder and it's files. I also have FTP set to chroot to the home directory.
    I have run into a couple problems with this.
    - First, if they were so inclined, the users could log in via SSH or an SCP program and get outside of their home directory. I would prefer that they were unable to. Can I set their shell to ftponly or something as such?
    - Second, I have an on site admin that is often called on by the website clients to make small changes to their site. And I'm not sure how to set up his access so that he can have the ability to FTP in, have full rwx access to the users files, overwrite them, and go about his business without having to than do a chown on the new files so that they are all owned by the end user. Is there an easy way to do this, or should I write a perl script that either triggers on his logout or that he can run, to set the chmod/chown correctly after he's done.

    LavaRider wrote:
    I have to create many LTS for the fact table......
    1 LTS for ProductFact
    1 LTS for ProductFact & PolicyFact (which contain ProductFact and PolicyFact as sources)
    1 LTS for ProductFact , PolicyFact & PolicyCoverFact ........
    and so on.....
    have I understood correctly? Is that what you mean?Yes, the reason why I said to "keep" the firsts fact table in each source is to make the dimension work.
    For example, if the "product dimension" is only linked to "product fact", but not "policy fact" then you won't be able to do a report based on "product dimension" and "policy fact". Right ? To be able to do this report, OBIEE must do a join with "product fact" (this fact table become an intersection table). That's why you will add product fact in the "policy fact" source. Same for others source.
    But the name of "ProductFact & PolicyFact" source can be "policy fact". Because each row of this source is a policy fact.
    For the 3rd table, each row is a "policy cover fact". But to be able to join with "product dimension" and "policy dimension", you need to integrate "policy fact" and "product fact" tables in the logical source.
    and so on.

  • How can i deal with Exception of URI

    I am learning Expression Language, in one of the examples, there is a sentence like this: <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jst1/fmt" %>.
    the browser will throw an exception:
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application.
    How can i do with it? Thanks!

    put the standard.jar on the apllication classpath WEB-INF/lib

  • How should one deal with sub-projects?

    Hello to all!
    Let me first clarify my title-question.
    On my current project I faced software malfunction [FCPX quitting] when I reached 17 minutes of building the video on the timeline. [As a reference, allow me to call this 17-minute part of the video in making as the main project.]
    Remembering from an earlier thread [? Mr. Russ being the contributor], I opted to continue the project as a separate project which I seek to call as the sub-project  Now even this sub-project is of a 14 minute duration and I have need to start a sub-project 2.
    I would now like to be guided as to how to deal with these sub-projects while editing the video and after finishing the project.
    Firstly, while editing. My present plan is to complete the project's video utilising as many sub-projects as needed, and then add the sub-projects to the main project. This done, I intend to add voiceover for the completed project. During this process, my questions are this...how do I add the sub-projects onto the main project? If I select and copy/paste the sub-project, it gets added as 'connected clips'...this is okay if one can export the project as such. But, when a voiceover has to be added, further retiming of the clips are called for and at this stage problems arise. Now, as I am writing this, it is striking me that I could make this added sub-project as a secondary storyline, get done with the retiming after the voiceover is added, and export the project. Have not done this before and would like guidance from senior contributors in this issue.
    Secondly, when the project is exported and is being archived, do I need to have all the sub-projects or delete them to save drive-space?
    Thanks in advance.
    Have a great day.
    Dr. Somanna

    Thanks Karsten for this further instructions. The present project I am working on is being done as a race against time. Faced a problem when dealing with a stack of generator clips one upon the other and each clip being given different commands regarding changes in position and rotation. Beyond the 17 minute mark, one click upon the parameter in the inspector window, and the application quit. When this quitting became a regular feature, I just remembered a thread in which one contributor wrote that he usually divides his projects into 10 minute bits before making up the whole project. Not willing to spend time further on this problem, being in a very 'creative frame mode' I simply continued working upon the project by starting up a 'sub-project'.
    Regards and take care.
    Dr. Somanna

  • Just installed Lion on one of my macbooks.  2nd macbook has tiger.  Have two iphones, both 3G.  Trying to decide how to deal with icloud.  I have mobile me working well now.  How should I deal with icloud while still with 2 3G iphones (mine

    I have 2 macbooks (mine & my wife's).  I just loaded osx Lion on my macbook. We have 2 iphones.  Both 3G.  I have two separate mobile me accounts that are working fine.  What is the best way for me to deal with icloud as long as we have two 3G iPhones?

    This is a user forum I feel you need to deal with Adobe customer services or support chat did not work in you case.

  • How can I deal with long sql by the oo4o?

    I am using VB and oo4o to develop a sql executor which is a extention of an old system.
    For some reason, I have to use oo4o v8.1.7 to deal with Oracle Database 8i to 11g.
    But when I send a very long sql(11KB) to it I got a error in the VB enviroment.
    The Err.Description is "automention error. Started object is disconnected by the client.".
    The Err.Number is "-2147417848 ".
    The sql that I send it to the program is a simple select sql that like select a, b, c, substrb(d, 1, 2), substrb(e, 2, 3) .... from A_TBL where A=aa;
    This sql is normally executed by the sqlplus but I got an error by the oo4o.
    When I insert a '' between the 30Xth items, it got exectuted normally.
    ex. select a, b, c, substrb(d, 1, 2), substrb(e, 1, 2) ..... substrb(303th, 3, 4), '', substrb(304th, 1, 2) ... from A_TBL where A = aa;
    How can I deal with this problem? Thanks.

    So how can use this function correctly?By learning what exceptions are, how they're used, and what you can do to deal with them. There's a tutorial here: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.htmlAnd here's a quick overview:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

  • How can I deal with an apostrophy

    My simple questions is how can I deal with an apostrophy when I trying to save to the table, here is an example in how I am saving.
    'Sandr'as Casa' this gives me an error message. I have to do it like this
    Strings.replace("Sandr'as Casa"," ' "," ' ' "), a package function
    SQLDesFollow = "UPDATE [CRVMReq] " +
    "SET [SkillSet]='" + Strings.replace("Sandr'as Casa"," ' "," ' ' ")+ "'" WHERE [ReqId]='" + ReqValuesReqId[4] + "";
    dbs.execute(SQLDesFollow);
    SQLDesFollow = "UPDATE [CRVMReq] " +
    "SET [SkillSet]='Sandr'as Casa' WHERE [ReqId]='" + ReqValuesReqId[4] + "";
    dbs.execute(SQLDesFollow);
    any help will be appreciated.

    Here is the magic word: PreparedStatement.
    Start here:
    http://java.sun.com/docs/books/tutorial/jdbc/basics/pr
    epared.htmlSeconded, thirded and fourthed.
    And if later readers of this thread feel that they would like to provide another answer then they should think again because they would be wrong.
    There is only one correct answer to this question. PreparedStatement.

  • How does one deal with transparency in a placed file in InDesign?

    I suppose this may seem elementary, but I'm relatively new to it so here goes:
    First off, my print shop says that placed images should be in EPS format. I'm creating my files in Illustrator and some of them use a gradient mask to fade an object away. When saved as an EPS, the gradient mask shows as a white box instead of fading into the background. When I copy/paste my Illustrator image into a new Photoshop file, save it as a PSD, bring that PSD into Illustrator and save it as an EPS, the whole file is in a white box.
    Example. I want those aisle markers to not be in white boxes.
    http://i.imgur.com/lZjtu.jpg
    How does one deal with transparency in a placed image in InDesign?
    Thanks.

    If possible, one finds a new printer who can handle your files properly and doesn't insist on .eps.
    What format are you delivering to the Printer? If it's anything other than PDF (and that's at their request) all the more reason to reread the first sentence. Why on earth are you moving things from Illustrator to Photoshop and back to Illustrator? Either one of those will save as .eps (ugh), though you need to use a clipping path for transparent areas coming out of photoshop (don't really know how Illy handles it when you say to save .eps with transparent background), but you are FAR better off with either native .AI or .PSD, both of which support transparencey, unlike .eps.If yo are delivering PDF, as you should be, it makes no difference to the printer what format the placed content uses (and it shouldn't matter to him even with native files unless he's hopelessly stuck in the 90s).
    In any event, when importing from Illustrator, make sure to show the import options and check the transparent background box.

  • Hyperlinks in cells, how do you deal with it?

    I've got the hyperlinks palette open (Windows menu / Interactive / Hyperlinks)
    Selecting a cell (or a table), that I would like to be clickable in a PDF, disables the hyperlinks address text field:
    Obviously hyperlinks from cells are not supported.
    How do you deal with it? Do you put empty textboxed on top of each cell that should be clickable?
    Thanks,
    Andreas

    @Andreas – to choose buttons over text based hyperlinks would mean you can define the area that is responsive like you want (the size is the size of the button) and you could design different button states in different ways (color, images, what not…).
    For the scripter in you: Hyperlink objects have no geometric bounds, Button objects have…
    Just an idea:
    Imagine a script that is scanning all cells of a selected table and if there are hyperlinks detected uses position, width and height of that cell to generate a button just on top of the cell (it could be well on a different layer above) using the information the hyperlink provides. Every time the table is changed by the user and the script is fired again, the old buttons are removed and new buttons will be built…
    If there are more hyperlinks than one in a specific cell, the buttons will be built around the area the hyperlinked text will occupy…
    Uwe

  • Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Welcome to Apple Support Communities
    Don't download MacKeeper. Users complain about this app and it damages OS X. Also, Mac OS X knows how to take care of itself, so you don't need any other cleaning application that may damage OS X. See > https://discussions.apple.com/docs/DOC-3691

  • How do I deal with constant "error loading content" messages?

    I'm constantly seeing error messages on my Apple TV (2nd gen) on content I easily watch on my other iDevices. What gives? This thing is rapidly becoming a vy expensive paper weight. Possibly the worst Apple product I've yet purchased. Am I alone in this?  What can I do?

    You cannot connect to TC using USB.
    Plug the TC into the computer using ethernet.
    Press and hold the reset button on the TC for about 10sec.. until front led rapidly flashes.. release it.
    Open the airport utility and make sure you can locate the TC. Check the disk page that the disk started up without errors.
    When you say
    Sodrawi wrote:
    How do I deal with the error message at my Time Capsule saying "There is a problem to connect to server xxxx-Time-Capsule.local."
    I am guessing you mean Time Machine.
    If TM still cannot find the TC disk.. reset TM and redo the setup.
    Read A4 here.
    http://pondini.org/TM/Troubleshooting.html

  • HT1420 I purchased new computers twice within the same year because they old were damaged in a storm.  However, I can't deauthorize/reauthorize the new computers.  How do I deal with this situation.

    I purchased new computers twice within the same year because they were damaged in a storm.  However, I can't deauthorize/reauthorize the new computers because it has been less than a year.  How do I deal with this situation?

    BrianBlaze wrote:
    I have 3 Computers at home, I am studying computer sciences and am constantly rerformatting my computers, installing windows and linux over and over again.... EVERYTIME I reformat I have to authorize the same computer and so it takes up one of my 5 authorized computers... Anyways after deauthorizing all my computers in september I was not aware I couldn't do it for another year (why does APPLE assume these stupid tactics prevent piracy). Anywysw I need to reach apple and have them make it so I can do it again. I had a similar problem with Playstation and when I called them they fixed it for me... even windows (which you can only have one serial per computer) made it easy because all I had to do was call them and they fixed it for me. Now I need APPLE to do the same and this is the only place I could see to actually say what is going on... I can't believe I have to do this with my iPhone... I wanted an mp3 player and a phone together and if I can't put new songs until September 20, 2012 I am going to freak out!
    HELP!
    Brian
    Try this link: http://www.howtogeek.com/howto/23974/beginner-deauthorize-all-computers-associat ed-with-your-itunes-account/

  • It says that "there was a problem connecting to the server". What's wrong with this, and how can I deal with this problem?

    I just got my new iPad Mini2, and when I choose "sign in with your apple ID", it says that "there was a problem connecting to the server". What's wrong with this, and how can I deal with this problem?

    1. Turn router off for 30 seconds and on again
    2. Settings>General>Reset>Reset Network Settings

  • HT5621 I have moved permanently from the US to live in the UK. when I try to download a UK app I am often told that I cannot use a UK Apple sstore, only a US store. I need to access various UK stores how can I deal with this?

    I have moved permanently from the US to live in the UK. when I try to download a UK app I am often told that I cannot use a UK Apple sstore, only a US store. I need to access various UK stores how can I deal with this?

    Try here
    http://support.apple.com/kb/HT1311
    when you have UK Cards etc best to change as well

Maybe you are looking for

  • Need advice on whether to build a traditional database layout or a property bag lookup format for new application?

    Hi, This may be a little of an open ended question, but Id like to ask the crowd as I have a delema to whether or not to use a standard database design or a propertybag/flatfile format and transform the information within my application? THE SITUATIO

  • Insert Time and Date into Microsoft Access from Lookout

    I have an SQLExec running to export data to Microsoft Access - I would like to get A) A time stamp also to insert and B) A time stamp with out / and : -- I have found it impossible (from my limited knowledge) to do any of these things. Dose anyone ha

  • G4 TV connection for home theater help

    Just inherited a G4 tower that I'm considering using to play vids on my old school TV (RCA and coax in only). I've been using my Macbook Pro to do this lately. Imagine my surprise when I found that my current DVI/video adapter does not fit the DVI on

  • EA16 manual billing  - customer fields

    Hello. Could you help me somebody? I want to add a customer field to transaction EA16. I need to fill a new customer fields in manual billing document as information . And this information  next time to transfer to BW from this manual billing. Is som

  • BGB Best path selection

    Hi, Could someone tell me why second path remains as best? MPLS_CORE#show ip bgp 192.168.1.0 BGP routing table entry for 192.168.1.0/24, version 27 Paths: (2 available, best #2, table default)   Advertised to update-groups:      1            Refresh