Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 1d2acf3

Browse files
authored
Merge pull request #53 from swiehr/master
Error handling
2 parents 0cfc002 + 528375b commit 1d2acf3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/patches/field_format.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def formatted_value(view, custom_field, value, customized=nil, html=false)
112112
else
113113
value.to_s
114114
end
115+
rescue
116+
value.to_s
115117
end
116118

117119
def validate_custom_field(custom_field)

lib/patches/klass.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def compute
2929
result.to_s
3030
end
3131
self.custom_field_values = {value.custom_field.id => result}
32-
rescue StandardError => e
32+
rescue StandardError, SyntaxError => e
3333
self.errors.add :base, l(:error_while_formula_computing,
3434
custom_field_name: value.custom_field.name,
3535
message: e.message)

0 commit comments

Comments
 (0)