encodeSafely

internal fun <T : Any> TypeCodec<T>.encodeSafely(value: T, writer: PgByteWriter)

Safely encodes a value using this TypeCodec. Any standard exceptions (like IllegalArgumentException or IllegalStateException) thrown by the codec's TypeCodec.toBinary method are caught and wrapped in a CodecException.