Add IgniteInvalidGridStateException instead of IllegalStateException in KernalGateway

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Add IgniteInvalidGridStateException instead of IllegalStateException in KernalGateway

Sergey Stronchinskiy
Dear Igniters,

I'm working on a bug in .NET code that handles transaction states (jira
ticket <https://issues.apache.org/jira/browse/IGNITE-13296>). And I need a
way to handle stopped grid exception, so I think it will make sense to
throw a specialized exception type in this case instead of a generic
IllegalStateException
<https://github.com/apache/ignite/blob/d486f24b1be3f08e8b1e5e9992c4c8718e169299/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java#L95>
.

Any objections?

Best regards!
Reply | Threaded
Open this post in threaded view
|

Re: Add IgniteInvalidGridStateException instead of IllegalStateException in KernalGateway

Pavel Tupitsyn
Sounds good to me.
We can include grid state as a property of that exception too.

On Fri, Jul 31, 2020 at 5:32 PM Guru Stron <[hidden email]>
wrote:

> Dear Igniters,
>
> I'm working on a bug in .NET code that handles transaction states (jira
> ticket <https://issues.apache.org/jira/browse/IGNITE-13296>). And I need a
> way to handle stopped grid exception, so I think it will make sense to
> throw a specialized exception type in this case instead of a generic
> IllegalStateException
> <
> https://github.com/apache/ignite/blob/d486f24b1be3f08e8b1e5e9992c4c8718e169299/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java#L95
> >
> .
>
> Any objections?
>
> Best regards!
>
Reply | Threaded
Open this post in threaded view
|

Re: Add IgniteInvalidGridStateException instead of IllegalStateException in KernalGateway

Pavel Tupitsyn
Actually, we already have IgniteIllegalStateException,
it exists exactly for situations like this.

Let's just change GridKernalGatewayImpl to throw IgniteIllegalStateException
instead of IllegalStateException and handle that in .NET

On Sat, Aug 1, 2020 at 10:32 AM Pavel Tupitsyn <[hidden email]> wrote:

> Sounds good to me.
> We can include grid state as a property of that exception too.
>
> On Fri, Jul 31, 2020 at 5:32 PM Guru Stron <[hidden email]>
> wrote:
>
>> Dear Igniters,
>>
>> I'm working on a bug in .NET code that handles transaction states (jira
>> ticket <https://issues.apache.org/jira/browse/IGNITE-13296>). And I need
>> a
>> way to handle stopped grid exception, so I think it will make sense to
>> throw a specialized exception type in this case instead of a generic
>> IllegalStateException
>> <
>> https://github.com/apache/ignite/blob/d486f24b1be3f08e8b1e5e9992c4c8718e169299/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java#L95
>> >
>> .
>>
>> Any objections?
>>
>> Best regards!
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Add IgniteInvalidGridStateException instead of IllegalStateException in KernalGateway

Sergey Stronchinskiy
Great find, Pavel!

Thank you, will go with it than.

On Mon, 31 Aug 2020 at 22:45, Pavel Tupitsyn <[hidden email]> wrote:

> Actually, we already have IgniteIllegalStateException,
> it exists exactly for situations like this.
>
> Let's just change GridKernalGatewayImpl to throw
> IgniteIllegalStateException
> instead of IllegalStateException and handle that in .NET
>
> On Sat, Aug 1, 2020 at 10:32 AM Pavel Tupitsyn <[hidden email]>
> wrote:
>
> > Sounds good to me.
> > We can include grid state as a property of that exception too.
> >
> > On Fri, Jul 31, 2020 at 5:32 PM Guru Stron <[hidden email]>
> > wrote:
> >
> >> Dear Igniters,
> >>
> >> I'm working on a bug in .NET code that handles transaction states (jira
> >> ticket <https://issues.apache.org/jira/browse/IGNITE-13296>). And I
> need
> >> a
> >> way to handle stopped grid exception, so I think it will make sense to
> >> throw a specialized exception type in this case instead of a generic
> >> IllegalStateException
> >> <
> >>
> https://github.com/apache/ignite/blob/d486f24b1be3f08e8b1e5e9992c4c8718e169299/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java#L95
> >> >
> >> .
> >>
> >> Any objections?
> >>
> >> Best regards!
> >>
> >
>