@@ -12,6 +12,7 @@ import (
12
12
13
13
"github.com/chnsz/golangsdk"
14
14
15
+ "github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/common"
15
16
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/config"
16
17
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/utils"
17
18
)
@@ -203,7 +204,9 @@ func resourcePgSqlLimitRead(_ context.Context, d *schema.ResourceData, meta inte
203
204
204
205
sqlLimit , err := getSqlLimit (client , d , "id" , d .Get ("sql_limit_id" ).(string ))
205
206
if err != nil {
206
- return diag .FromErr (err )
207
+ return common .CheckDeletedDiag (d ,
208
+ common .ConvertExpected400ErrInto404Err (err , "error_code" , "DBS.01010340" ),
209
+ "error retrieving RDS PostgreSQL SQL limit" )
207
210
}
208
211
209
212
isEffective := utils .PathSearch ("is_effective" , sqlLimit , false ).(bool )
@@ -246,7 +249,7 @@ func getSqlLimit(client *golangsdk.ServiceClient, d *schema.ResourceData, queryF
246
249
getPath = getBasePath + buildGetSqlLimitQueryParams (currentTotal )
247
250
getResp , err := client .Request ("GET" , getPath , & getOpt )
248
251
if err != nil {
249
- return nil , fmt . Errorf ( "error retrieving RDS PostgreSQL SQL limit: %s" , err )
252
+ return nil , err
250
253
}
251
254
252
255
getRespBody , err := utils .FlattenResponse (getResp )
0 commit comments