Commit 4dc816141eb2bc464be198c0fb6dbcd8c95f2b26
Committed by
Paulo Meireles
1 parent
7e930637
Exists in
master
and in
28 other branches
[Mezuro] added error treatment to module_result and result hystory
Showing
1 changed file
with
10 additions
and
2 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin/project_content.rb
| ... | ... | @@ -48,11 +48,19 @@ Kalibro::ProjectResult.first_result_after(name, date) |
| 48 | 48 | def module_result(attributes) |
| 49 | 49 | module_name = attributes[:module_name].nil? ? project.name : attributes[:module_name] |
| 50 | 50 | date = attributes[:date].nil? ? project_result.date : project_result_with_date(attributes[:date]).date |
| 51 | - @module_result ||= Kalibro::ModuleResult.find_by_project_name_and_module_name_and_date(name, module_name, date) | |
| 51 | + begin | |
| 52 | + @module_result ||= Kalibro::ModuleResult.find_by_project_name_and_module_name_and_date(name, module_name, date) | |
| 53 | + rescue Exception => error | |
| 54 | + errors.add_to_base(error.message) | |
| 55 | + end | |
| 52 | 56 | end |
| 53 | 57 | |
| 54 | 58 | def result_history(module_name) |
| 55 | - @result_history ||= Kalibro::ModuleResult.all_by_project_name_and_module_name(name, module_name) | |
| 59 | + begin | |
| 60 | + @result_history ||= Kalibro::ModuleResult.all_by_project_name_and_module_name(name, module_name) | |
| 61 | + rescue Exception => error | |
| 62 | + errors.add_to_base(error.message) | |
| 63 | + end | |
| 56 | 64 | end |
| 57 | 65 | |
| 58 | 66 | after_save :send_project_to_service | ... | ... |