[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class PGExceptionFactory (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.error.PGExceptionFactory) \n\n public class PGExceptionFactory\n\nFactory class for [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException) instances. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e PGExceptionFactory \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### \\\u003cT\\\u003echeckArgument(T value, boolean valid, String message)\n\n public static T \u003cT\u003echeckArgument(T value, boolean valid, String message)\n\nThrows a [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException) with the given message and [SQLState#InvalidParameterValue](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.SQLState#com_google_cloud_spanner_pgadapter_error_SQLState_InvalidParameterValue)\nif valid is false. Otherwise, returns the given value.\n\n### newPGException(String message)\n\n public static PGException newPGException(String message)\n\nCreates a basic [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException) with [Severity#ERROR](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.Severity#com_google_cloud_spanner_pgadapter_error_Severity_ERROR) and [SQLState#RaiseException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.SQLState#com_google_cloud_spanner_pgadapter_error_SQLState_RaiseException).\n\n### newPGException(String message, SQLState sqlState)\n\n public static PGException newPGException(String message, SQLState sqlState)\n\nCreates a basic [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException) with [Severity#ERROR](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.Severity#com_google_cloud_spanner_pgadapter_error_Severity_ERROR) and the specified [SQLState](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.SQLState).\n\n### newQueryCancelledException()\n\n public static PGException newQueryCancelledException()\n\nCreates a new exception that indicates that the current query was cancelled by the client.\n\n### newTransactionAbortedException()\n\n public static PGException newTransactionAbortedException()\n\nCreates a new exception that indicates that the current transaction is in the aborted state.\n\n### toPGException(SpannerException spannerException)\n\n public static PGException toPGException(SpannerException spannerException)\n\nConverts the given SpannerException to a [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException).\n\n### toPGException(Throwable throwable)\n\n public static PGException toPGException(Throwable throwable)\n\nConverts the given Exception to a [PGException](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.error.PGException)."]]