From cc3c7722d98c831e918bd5563a7a991e317feef9 Mon Sep 17 00:00:00 2001
From: Carlos Morais
Date: Thu, 8 Dec 2011 11:55:11 -0200
Subject: [PATCH] Showing error stack trace
---
plugins/mezuro/views/content_viewer/show_project.rhtml | 92 +++++++++++---------------------------------------------------------------------------------
1 file changed, 11 insertions(+), 81 deletions(-)
diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml
index 257b387..2204cf2 100644
--- a/plugins/mezuro/views/content_viewer/show_project.rhtml
+++ b/plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -1,6 +1,5 @@
<% @project = Kalibro::Client::ProjectClient.new.project(@page.name) %>
- <%= @project.name %>'s Info
<%= _("Name") %> |
@@ -15,99 +14,30 @@
<%= @project.description %> |
- <%= _("Repository type") %> |
+ <%= _("Repository type") %> |
<%= @project.repository.type %> |
- <%= _("Repository address") %> |
+ <%= _("Repository address") %> |
<%= @project.repository.address %> |
- <%= _("Configuration") %> |
+ <%= _("Configuration") %> |
<%= @project.configuration_name %> |
-<% if @project.state == 'ERROR' %>
+<% if ! @project.error.nil? %>
ERROR
-
-
+ <% @error = @project.error %>
- <%= _("Possible causes:") %>
-
- - <%= _("Server is down") %>
- - <%= _("Invalid URL") %>
- - <%= _("Incorrect language") %>
-
+ <%= "State when error ocurred: #{@project.state}" %>
+
+ <%= @error.message %>
+ <% @error.stack_trace.each do |trace| %>
+ - <%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %>
+ <% end %>
<% end %>
-
-<% if @project.state.end_with? 'ING' %>
-
- <%= _("The server is calculating metric results.
Reload the page manually in a few moments.") %>
-
-<% end %>
-
-
-<% if @project.state == 'READY' %>
-
- <% if @project.configuration.nil? %>
- <% metric_results = @client.last_module_result(@project.name).metric_results %>
-
- <%= _("Total Metrics") %>
-
- <% total_results = metric_results.each.select {|result| result.native_metric.scope == 'APPLICATION'} %>
- <% total_results.each_with_index do |result, index| %>
-
- <%= result.native_metric.name %> |
- <%= result.value %> |
-
- <% end %>
-
-
- <%= _("Statistical Metrics") %>
- <% statistical_results = metric_results.each.select {|result| result.native_metric.scope == 'CLASS'} %>
- <% statistical_results.each do |result| %>
-
-
-
-
-
-
-
- <%= "#{result.native_metric.name}" %>
- |
-
- <%= "#{result.average}"%>
- |
-
- <% result.available_statistics.each_with_index do |statistic, index| %>
-
- <%= statistic %> |
- <%= result.statistic(statistic) %> |
-
- <% end %>
-
-
- <% end %>
-
- <% else %>
- <% metric_results = @client.last_module_result(@project.name).compiled_metric_results %>
-
- <%= _("Metrics") %>
-
- <% metric_results.each do |result| %>
-
- <%= result.native_metric.name %> |
- <%= result.value %> |
-
- <% end %>
-
- <% end %>
-<% end %>
--
libgit2 0.21.2