@@ -134,6 +134,39 @@ func TestAuroraInternalWALErrorShouldBeRecoverable(t *testing.T) {
134134 }, errInfo , "Unexpected error info" )
135135}
136136
137+ func TestNeonProjectQuotaExceededErrorShouldBeConnectivity (t * testing.T ) {
138+ // Simulate a Neon project quota exceeded error
139+ err := & pgconn.PgError {
140+ Severity : "ERROR" ,
141+ Code : pgerrcode .InternalError ,
142+ Message : "Your account or project has exceeded the compute time quota. Upgrade your plan to increase limits." ,
143+ }
144+ errorClass , errInfo := GetErrorClass (t .Context (),
145+ exceptions .NewPeerCreateError (fmt .Errorf ("failed to create connection: failed to connect to `<user, host>: server error: `: %w" , err )))
146+ assert .Equal (t , ErrorNotifyConnectivity , errorClass , "Unexpected error class" )
147+ assert .Equal (t , ErrorInfo {
148+ Source : ErrorSourcePostgres ,
149+ Code : pgerrcode .InternalError ,
150+ }, errInfo , "Unexpected error info" )
151+ }
152+
153+ func TestPostgresMemoryAllocErrorShouldBeSlotMemalloc (t * testing.T ) {
154+ // Simulate a Postgres memory allocation error
155+ err := & exceptions.PostgresWalError {
156+ Msg : & pgproto3.ErrorResponse {
157+ Severity : "ERROR" ,
158+ Code : pgerrcode .InternalError ,
159+ Message : "invalid memory alloc request size 1073741824" ,
160+ },
161+ }
162+ errorClass , errInfo := GetErrorClass (t .Context (), fmt .Errorf ("error in WAL: %w" , err ))
163+ assert .Equal (t , ErrorPostgresSlotMemalloc , errorClass , "Unexpected error class" )
164+ assert .Equal (t , ErrorInfo {
165+ Source : ErrorSourcePostgres ,
166+ Code : pgerrcode .InternalError ,
167+ }, errInfo , "Unexpected error info" )
168+ }
169+
137170func TestClickHouseAccessEntityNotFoundErrorShouldBeRecoverable (t * testing.T ) {
138171 // Simulate a ClickHouse access entity not found error
139172 for idx , msg := range []string {
0 commit comments