You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Yingyi Bu <bu...@gmail.com> on 2017/01/05 19:12:30 UTC

Exception refactoring proposal

Hi dev,

    I recent made a change that moved some exception error message
templates from the source code into properties files [1]. Here is an
exception refactoring proposal [2].

    I propose that:
    --  from now on, we all follow the proposal when we want to throw
exceptions, and enforce the key design during our code reviews.
    --  for existing code that does not follow the proposal, we refactor
them gradually according to the proposal.

    Feel free to share your thoughts.
    Thanks!

Best,
Yingyi

[1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
[2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Exception+Handling

Re: Exception refactoring proposal

Posted by Mike Carey <dt...@gmail.com>.
:-)  Makes sense.


On 1/6/17 3:27 PM, Till Westmann wrote:
> Hi,
>
> I like the proposal and I\u2019d like to propose on more change:
> Let\u2019s not start the names of ErrorCodes with "ERROR_".
> In the code they are usually used as
>
>     ErrorCode.ERROR_THIS_IS_THE_PROBLEM
>
> and it seems that
>
>     ErrorCode.THIS_IS_THE_PROBLEM
>
> would work just as well.
>
> Thoughts?
>
> Cheers,
> Till
>
>
> On 5 Jan 2017, at 11:12, Yingyi Bu wrote:
>
>> Hi dev,
>>
>>     I recent made a change that moved some exception error message
>> templates from the source code into properties files [1]. Here is an
>> exception refactoring proposal [2].
>>
>>     I propose that:
>>     --  from now on, we all follow the proposal when we want to throw
>> exceptions, and enforce the key design during our code reviews.
>>     --  for existing code that does not follow the proposal, we refactor
>> them gradually according to the proposal.
>>
>>     Feel free to share your thoughts.
>>     Thanks!
>>
>> Best,
>> Yingyi
>>
>> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
>> [2] 
>> https://cwiki.apache.org/confluence/display/ASTERIXDB/Exception+Handling


Re: Exception refactoring proposal

Posted by Yingyi Bu <bu...@gmail.com>.
All right, sounds good!

Best,
Yingyi

On Fri, Jan 6, 2017 at 3:36 PM, Till Westmann <ti...@apache.org> wrote:

> Yes, that’s what I would think as well.
>
> Cheers,
> Till
>
> On 6 Jan 2017, at 15:30, Yingyi Bu wrote:
>
> > Sounds good to me.
> > I'm guessing that eventually WARNINGs will also have WaringCode.java?
> > (Although we currently don't have WARNING channels...)
> >
> > Best,
> > Yingyi
> >
> > On Fri, Jan 6, 2017 at 3:27 PM, Till Westmann <ti...@apache.org> wrote:
> >
> >> Hi,
> >>
> >> I like the proposal and I’d like to propose on more change:
> >> Let’s not start the names of ErrorCodes with "ERROR_".
> >> In the code they are usually used as
> >>
> >>     ErrorCode.ERROR_THIS_IS_THE_PROBLEM
> >>
> >> and it seems that
> >>
> >>     ErrorCode.THIS_IS_THE_PROBLEM
> >>
> >> would work just as well.
> >>
> >> Thoughts?
> >>
> >> Cheers,
> >> Till
> >>
> >>
> >>
> >> On 5 Jan 2017, at 11:12, Yingyi Bu wrote:
> >>
> >> Hi dev,
> >>>
> >>>     I recent made a change that moved some exception error message
> >>> templates from the source code into properties files [1]. Here is an
> >>> exception refactoring proposal [2].
> >>>
> >>>     I propose that:
> >>>     --  from now on, we all follow the proposal when we want to throw
> >>> exceptions, and enforce the key design during our code reviews.
> >>>     --  for existing code that does not follow the proposal, we
> refactor
> >>> them gradually according to the proposal.
> >>>
> >>>     Feel free to share your thoughts.
> >>>     Thanks!
> >>>
> >>> Best,
> >>> Yingyi
> >>>
> >>> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
> >>> [2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Except
> >>> ion+Handling
> >>>
> >>
>

Re: Exception refactoring proposal

Posted by Till Westmann <ti...@apache.org>.
Yes, that\u2019s what I would think as well.

Cheers,
Till

On 6 Jan 2017, at 15:30, Yingyi Bu wrote:

> Sounds good to me.
> I'm guessing that eventually WARNINGs will also have WaringCode.java?
> (Although we currently don't have WARNING channels...)
>
> Best,
> Yingyi
>
> On Fri, Jan 6, 2017 at 3:27 PM, Till Westmann <ti...@apache.org> wrote:
>
>> Hi,
>>
>> I like the proposal and I\u2019d like to propose on more change:
>> Let\u2019s not start the names of ErrorCodes with "ERROR_".
>> In the code they are usually used as
>>
>>     ErrorCode.ERROR_THIS_IS_THE_PROBLEM
>>
>> and it seems that
>>
>>     ErrorCode.THIS_IS_THE_PROBLEM
>>
>> would work just as well.
>>
>> Thoughts?
>>
>> Cheers,
>> Till
>>
>>
>>
>> On 5 Jan 2017, at 11:12, Yingyi Bu wrote:
>>
>> Hi dev,
>>>
>>>     I recent made a change that moved some exception error message
>>> templates from the source code into properties files [1]. Here is an
>>> exception refactoring proposal [2].
>>>
>>>     I propose that:
>>>     --  from now on, we all follow the proposal when we want to throw
>>> exceptions, and enforce the key design during our code reviews.
>>>     --  for existing code that does not follow the proposal, we refactor
>>> them gradually according to the proposal.
>>>
>>>     Feel free to share your thoughts.
>>>     Thanks!
>>>
>>> Best,
>>> Yingyi
>>>
>>> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
>>> [2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Except
>>> ion+Handling
>>>
>>

Re: Exception refactoring proposal

Posted by Yingyi Bu <bu...@gmail.com>.
Sounds good to me.
I'm guessing that eventually WARNINGs will also have WaringCode.java?
(Although we currently don't have WARNING channels...)

Best,
Yingyi

On Fri, Jan 6, 2017 at 3:27 PM, Till Westmann <ti...@apache.org> wrote:

> Hi,
>
> I like the proposal and I’d like to propose on more change:
> Let’s not start the names of ErrorCodes with "ERROR_".
> In the code they are usually used as
>
>     ErrorCode.ERROR_THIS_IS_THE_PROBLEM
>
> and it seems that
>
>     ErrorCode.THIS_IS_THE_PROBLEM
>
> would work just as well.
>
> Thoughts?
>
> Cheers,
> Till
>
>
>
> On 5 Jan 2017, at 11:12, Yingyi Bu wrote:
>
> Hi dev,
>>
>>     I recent made a change that moved some exception error message
>> templates from the source code into properties files [1]. Here is an
>> exception refactoring proposal [2].
>>
>>     I propose that:
>>     --  from now on, we all follow the proposal when we want to throw
>> exceptions, and enforce the key design during our code reviews.
>>     --  for existing code that does not follow the proposal, we refactor
>> them gradually according to the proposal.
>>
>>     Feel free to share your thoughts.
>>     Thanks!
>>
>> Best,
>> Yingyi
>>
>> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
>> [2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Except
>> ion+Handling
>>
>

Re: Exception refactoring proposal

Posted by Taewoo Kim <wa...@gmail.com>.
+1

Best,
Taewoo

On Fri, Jan 6, 2017 at 3:27 PM, Till Westmann <ti...@apache.org> wrote:

> Hi,
>
> I like the proposal and I’d like to propose on more change:
> Let’s not start the names of ErrorCodes with "ERROR_".
> In the code they are usually used as
>
>     ErrorCode.ERROR_THIS_IS_THE_PROBLEM
>
> and it seems that
>
>     ErrorCode.THIS_IS_THE_PROBLEM
>
> would work just as well.
>
> Thoughts?
>
> Cheers,
> Till
>
>
>
> On 5 Jan 2017, at 11:12, Yingyi Bu wrote:
>
> Hi dev,
>>
>>     I recent made a change that moved some exception error message
>> templates from the source code into properties files [1]. Here is an
>> exception refactoring proposal [2].
>>
>>     I propose that:
>>     --  from now on, we all follow the proposal when we want to throw
>> exceptions, and enforce the key design during our code reviews.
>>     --  for existing code that does not follow the proposal, we refactor
>> them gradually according to the proposal.
>>
>>     Feel free to share your thoughts.
>>     Thanks!
>>
>> Best,
>> Yingyi
>>
>> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
>> [2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Except
>> ion+Handling
>>
>

Re: Exception refactoring proposal

Posted by Till Westmann <ti...@apache.org>.
Hi,

I like the proposal and I\u2019d like to propose on more change:
Let\u2019s not start the names of ErrorCodes with "ERROR_".
In the code they are usually used as

     ErrorCode.ERROR_THIS_IS_THE_PROBLEM

and it seems that

     ErrorCode.THIS_IS_THE_PROBLEM

would work just as well.

Thoughts?

Cheers,
Till


On 5 Jan 2017, at 11:12, Yingyi Bu wrote:

> Hi dev,
>
>     I recent made a change that moved some exception error message
> templates from the source code into properties files [1]. Here is an
> exception refactoring proposal [2].
>
>     I propose that:
>     --  from now on, we all follow the proposal when we want to throw
> exceptions, and enforce the key design during our code reviews.
>     --  for existing code that does not follow the proposal, we 
> refactor
> them gradually according to the proposal.
>
>     Feel free to share your thoughts.
>     Thanks!
>
> Best,
> Yingyi
>
> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
> [2] 
> https://cwiki.apache.org/confluence/display/ASTERIXDB/Exception+Handling

Re: Exception refactoring proposal

Posted by Mike Carey <dt...@gmail.com>.
+1;

:-)


On 1/5/17 11:12 AM, Yingyi Bu wrote:
> Hi dev,
>
>      I recent made a change that moved some exception error message
> templates from the source code into properties files [1]. Here is an
> exception refactoring proposal [2].
>
>      I propose that:
>      --  from now on, we all follow the proposal when we want to throw
> exceptions, and enforce the key design during our code reviews.
>      --  for existing code that does not follow the proposal, we refactor
> them gradually according to the proposal.
>
>      Feel free to share your thoughts.
>      Thanks!
>
> Best,
> Yingyi
>
> [1] https://asterix-gerrit.ics.uci.edu/#/c/1410/
> [2] https://cwiki.apache.org/confluence/display/ASTERIXDB/Exception+Handling
>