[ 
https://issues.apache.org/jira/browse/DERBY-3064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530938
 ] 

Jørgen Løland commented on DERBY-3064:
--------------------------------------

If I understand you correctly, you are asking two questions: 

Q1. Should LogShipper throw all exceptions to MasterController even in cases 
where it can do something meaningful with it?

Q2. Should the LogShipper wrap exceptions in StandardExceptions before throwing 
them to MasterController.


A1. As a general rule of thumb when it comes to exceptions, I think you need to 
decide whether or not your code can do anything about it or if it needs to be 
handled by code at a higher level. If your code can handle it, you may fix the 
problem and not throw the exception further (in this case from LogShipper to 
MasterController).

A2. I don't think you should wrap an exception in a StandardException at any 
lower level than MasterController; let the controller decide which exceptions 
are fatal and which can be handled. That is easier to do with the original 
exception at hand than with a StandardException.

Of course, nothing but StandardException should be seen outside the replication 
package, so MasterController has to wrap before throwing.


As I see it, your alternatives are not mutually exclusive. I think you can 
actually do a little bit of alternative 1) and a little bit of alternative 2) 
:-D 

> Implement the LogShipper that will enable the shipping of Log records from 
> the master to the slave
> --------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3064
>                 URL: https://issues.apache.org/jira/browse/DERBY-3064
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: V.Narayanan
>            Assignee: V.Narayanan
>         Attachments: LogShipperImpl_v1.diff, LogShipperImpl_v1.stat, 
> LogShipperImpl_v2.diff, LogShipperImpl_v2.stat
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to