getErrorResponse gets in standard error and resource value and provides a encodable populated response values
(ctx context.Context, err APIError, resource, requestID, hostID string)
| 2443 | // getErrorResponse gets in standard error and resource value and |
| 2444 | // provides a encodable populated response values |
| 2445 | func getAPIErrorResponse(ctx context.Context, err APIError, resource, requestID, hostID string) APIErrorResponse { |
| 2446 | reqInfo := logger.GetReqInfo(ctx) |
| 2447 | return APIErrorResponse{ |
| 2448 | Code: err.Code, |
| 2449 | Message: err.Description, |
| 2450 | BucketName: reqInfo.BucketName, |
| 2451 | Key: reqInfo.ObjectName, |
| 2452 | Resource: resource, |
| 2453 | Region: globalSite.Region, |
| 2454 | RequestID: requestID, |
| 2455 | HostID: hostID, |
| 2456 | } |
| 2457 | } |