@@ -261,6 +261,31 @@ func (c *clientAdmin) GetStartupConfiguration(ctx context.Context) (map[string]i
261261 case http .StatusOK :
262262 return response , nil
263263 default :
264+ // Try to extract error details from the response map
265+ // ArangoDB error responses include: error, code, errorNum, errorMessage
266+ if errorVal , hasError := response ["error" ]; hasError {
267+ if errorBool , ok := errorVal .(bool ); ok && errorBool {
268+ // This is an error response, extract error details
269+ errorStruct := shared.ResponseStruct {}
270+ if codeVal , ok := response ["code" ].(float64 ); ok {
271+ codeInt := int (codeVal )
272+ errorStruct .Code = & codeInt
273+ }
274+ if errorNumVal , ok := response ["errorNum" ].(float64 ); ok {
275+ errorNumInt := int (errorNumVal )
276+ errorStruct .ErrorNum = & errorNumInt
277+ }
278+ if errorMsgVal , ok := response ["errorMessage" ].(string ); ok {
279+ errorStruct .ErrorMessage = & errorMsgVal
280+ }
281+ if errorStruct .Code != nil || errorStruct .ErrorNum != nil || errorStruct .ErrorMessage != nil {
282+ errorBool := true
283+ errorStruct .Error = & errorBool
284+ return nil , errorStruct .AsArangoError ()
285+ }
286+ }
287+ }
288+ // Fallback to code-only error if we couldn't parse error details
264289 return nil , (& shared.ResponseStruct {}).AsArangoErrorWithCode (code )
265290 }
266291}
@@ -281,6 +306,31 @@ func (c *clientAdmin) GetStartupConfigurationDescription(ctx context.Context) (m
281306 case http .StatusOK :
282307 return response , nil
283308 default :
309+ // Try to extract error details from the response map
310+ // ArangoDB error responses include: error, code, errorNum, errorMessage
311+ if errorVal , hasError := response ["error" ]; hasError {
312+ if errorBool , ok := errorVal .(bool ); ok && errorBool {
313+ // This is an error response, extract error details
314+ errorStruct := shared.ResponseStruct {}
315+ if codeVal , ok := response ["code" ].(float64 ); ok {
316+ codeInt := int (codeVal )
317+ errorStruct .Code = & codeInt
318+ }
319+ if errorNumVal , ok := response ["errorNum" ].(float64 ); ok {
320+ errorNumInt := int (errorNumVal )
321+ errorStruct .ErrorNum = & errorNumInt
322+ }
323+ if errorMsgVal , ok := response ["errorMessage" ].(string ); ok {
324+ errorStruct .ErrorMessage = & errorMsgVal
325+ }
326+ if errorStruct .Code != nil || errorStruct .ErrorNum != nil || errorStruct .ErrorMessage != nil {
327+ errorBool := true
328+ errorStruct .Error = & errorBool
329+ return nil , errorStruct .AsArangoError ()
330+ }
331+ }
332+ }
333+ // Fallback to code-only error if we couldn't parse error details
284334 return nil , (& shared.ResponseStruct {}).AsArangoErrorWithCode (code )
285335 }
286336}
0 commit comments