Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX:Exceptions

 
Peter Kovgan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My starter intrface DBMain must call RecordNotFoundException,
I'll catch this exception in local mode.
But in network mode, what exception should I catch?
RemoteException only(which may be produced from RecordNotFoundException(???)) or 2 separate RemoteException and RecordNotFoundException?
Or I must wrap RemoteException into some another?
Every help will help.
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,

But in network mode, what exception should I catch?
RemoteException only(which may be produced from RecordNotFoundException(???)) or 2 separate RemoteException and RecordNotFoundException?
Or I must wrap RemoteException into some another?

I would not chain RecordNotFoundException into RemoteException. RemoteException is a system exception, RecordNotFoundException is an application one.
I, personally, would chain RemoteException in the general system exception, used also by the local interface to report system problems (e.g. DatabaseException).
Best,
Vlad
[ November 06, 2003: Message edited by: Vlad Rabkin ]
[ November 06, 2003: Message edited by: Vlad Rabkin ]
[ November 06, 2003: Message edited by: Vlad Rabkin ]
 
Peter Kovgan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
T H A N K Y O U!!!
 
Paul Tongyoo
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Kovgan:
[QB]My starter intrface DBMain must call RecordNotFoundException,
I'll catch this exception in local mode.
But in network mode, ...QB]


Hi Peter--
I made it a conscious point to make each exception that was explicitly declared in the DB interface (which i hope is the same as DBMain?) to be passed up the system layers (db->network->gui) via exception chaining. My interpretation of DuplicateKeyException/RecordNotFoundException/SecurityException is that they are more of the "business-level" type of exception (could be percieved as having some value to the user; more so than IllegalArgumentException, for example) and should display some indicator in the GUI that one of these exceptions has been thrown (in a user-friendly way, of course).
I also think the GUI side of the program should operate identically in all relevant modes (client and stand-alone), so you should pass the same exceptions (indicate the same errors to the user) for each.

More thoughts for food. HTH!

Paul
[ November 06, 2003: Message edited by: Paul Tongyoo ]
[ November 06, 2003: Message edited by: Paul Tongyoo ]
 
Peter Kovgan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul hi!

I made it a conscious point to make each exception that was explicitly declared in the DB interface (which i hope is the same as DBMain?) to be passed up the system layers (db->network->gui) via exception chaining. My interpretation of DuplicateKeyException/RecordNotFoundException/SecurityException is that they are more of the "business-level" type of exception

I'm not agree, for example RecordNotFoundException is good one to signal
for GUI about disappeared record..(for gui- disappeared "contractor").
RemoteException?
Is it so important don't show to client which exception he has?
I mean what a reason to chain remote into SomeAnotherException?
A...I understand.. to catch the same in both remote and local modes
we need to hide RemoteExcetion, as in Vlad's example...
[ November 06, 2003: Message edited by: Peter Kovgan ]
 
Paul Tongyoo
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Kovgan:
[QB]...
RemoteException?
Is it so important don't show to client which exception he has?
I mean what a reason to chain remote into SomeAnotherException?
...
QB]


Oh-- maybe I should've been more clear about what I meant by a "user-friendly" error notification. It'd be so friendly that it wouldn't even mention the actual exception, just that an error occurred. In the case of my RemoteException message, I believe I displayed to the user that "An error occurred while communicating with the server."
Regards,
Paul
[ November 06, 2003: Message edited by: Paul Tongyoo ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic