Class PGExceptionFactory (0.9.0)

publicclass PGExceptionFactory

Factory class for PGException instances.

Inheritance

java.lang.Object > PGExceptionFactory

Static Methods

newPGException(String message)

publicstaticPGExceptionnewPGException(Stringmessage)
Parameter
Name Description
message String
Returns
Type Description

newPGException(String message, SQLState sqlState)

publicstaticPGExceptionnewPGException(Stringmessage,SQLStatesqlState)

Creates a basic PGException with Severity#ERROR and the specified SQLState.

Parameters
Name Description
message String
sqlState SQLState
Returns
Type Description

newQueryCancelledException()

publicstaticPGExceptionnewQueryCancelledException()

Creates a new exception that indicates that the current query was cancelled by the client.

Returns
Type Description

toPGException(SpannerException spannerException)

publicstaticPGExceptiontoPGException(SpannerExceptionspannerException)

Converts the given SpannerException to a PGException.

Parameter
Name Description
spannerException com.google.cloud.spanner.SpannerException
Returns
Type Description

toPGException(Exception exception)

publicstaticPGExceptiontoPGException(Exceptionexception)

Converts the given Exception to a PGException.

Parameter
Name Description
exception Exception
Returns
Type Description

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.