Skip to content

Commit

Permalink
[Chore] Make error as a local variable (ray-project#2841)
Browse files Browse the repository at this point in the history
Signed-off-by: fscnick <[email protected]>
  • Loading branch information
fscnick authored Jan 28, 2025
1 parent d64bf59 commit 2b31c30
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ray-operator/controllers/ray/utils/dashboard_httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@ func ConvertRayJobToReq(rayJob *rayv1.RayJob) (*RayJobRequest, error) {

func UnmarshalRuntimeEnvYAML(runtimeEnvYAML string) (RuntimeEnvType, error) {
var runtimeEnv RuntimeEnvType
err := yaml.Unmarshal([]byte(runtimeEnvYAML), &runtimeEnv)
if err != nil {
if err := yaml.Unmarshal([]byte(runtimeEnvYAML), &runtimeEnv); err != nil {
return nil, fmt.Errorf("failed to unmarshal RuntimeEnvYAML: %v: %w", runtimeEnvYAML, err)
}
return runtimeEnv, nil
Expand Down

0 comments on commit 2b31c30

Please sign in to comment.