[ARVADOS] updated: 35806ff1bb3106bcf5874f2b3956fb785acc852a
Git user
git at public.curoverse.com
Tue Aug 16 17:10:06 EDT 2016
Summary of changes:
services/api/app/models/workflow.rb | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
via 35806ff1bb3106bcf5874f2b3956fb785acc852a (commit)
from bb741f18407fd0190e1b6c642c14ef9f502b004e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 35806ff1bb3106bcf5874f2b3956fb785acc852a
Author: radhika <radhika at curoverse.com>
Date: Tue Aug 16 17:09:33 2016 -0400
9684: workflow yaml error logging
diff --git a/services/api/app/models/workflow.rb b/services/api/app/models/workflow.rb
index 97be6dc..ea3e985 100644
--- a/services/api/app/models/workflow.rb
+++ b/services/api/app/models/workflow.rb
@@ -15,26 +15,28 @@ class Workflow < ArvadosModel
def validate_workflow
begin
@workflow_yaml = YAML.load self.workflow if !workflow.nil?
- rescue
- errors.add :validate_workflow, "#{self.workflow} is not valid yaml"
+ rescue => e
+ errors.add :workflow, "is not valid yaml: #{e.message}"
end
end
def set_name_and_description
+ old_wf = {}
begin
- old_wf = {}
old_wf = YAML.load self.workflow_was if !self.workflow_was.nil?
- ['name', 'description'].each do |a|
- if !self.changes.include?(a)
- v = self.read_attribute(a)
- if !v.present? or v == old_wf[a]
- val = @workflow_yaml[a] if self.workflow and @workflow_yaml
- self[a] = val
- end
+ rescue => e
+ logger.warn "set_name_and_description error: #{e.message}"
+ return
+ end
+
+ ['name', 'description'].each do |a|
+ if !self.changes.include?(a)
+ v = self.read_attribute(a)
+ if !v.present? or v == old_wf[a]
+ val = @workflow_yaml[a] if self.workflow and @workflow_yaml
+ self[a] = val
end
end
- rescue ActiveRecord::RecordInvalid
- errors.add :set_name_and_description, "#{self.workflow_was} is not valid yaml"
end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list