Display full error information for build errors in superuser view

Allows for easier debugging of build failures

Fixes https://www.pivotaltracker.com/story/show/142883625
This commit is contained in:
Joseph Schorr 2017-04-03 15:30:15 -04:00
parent 880bcebd6c
commit 21d86597cf
3 changed files with 26 additions and 5 deletions

View file

@ -17,5 +17,13 @@
<!-- Other issue --> <!-- Other issue -->
<span bo-if="!isPullError(error) || !localPullInfo.isLocal" <span bo-if="!isPullError(error) || !localPullInfo.isLocal"
class="error-message" bo-text="error.message"></span> class="error-message" bo-text="error.message"></span>
<!-- Extended error information -->
<div bo-if="getBaseError(error) && isSuperuser">
Base Error Information: <pre>{{ getBaseError(entries) }}</pre>
</div>
<div bo-if="getInternalError(entries) && isSuperuser">
Internal Error Information: <pre>{{ getInternalError(entries) }}</pre>
</div>
</span> </span>
</div> </div>

View file

@ -49,7 +49,7 @@
<span class="container-content build-log-phase" phase="container"></span> <span class="container-content build-log-phase" phase="container"></span>
</div> </div>
<div ng-switch-when="error"> <div ng-switch-when="error">
<span class="container-content build-log-error" error="container" entries="logEntries"></span> <span class="container-content build-log-error" error="container" is-superuser="isSuperuser" entries="logEntries"></span>
</div> </div>
<div ng-switch-when="command"> <div ng-switch-when="command">
<span class="container-content build-log-command" command="container"></span> <span class="container-content build-log-command" command="container"></span>

View file

@ -10,7 +10,8 @@ angular.module('quay').directive('buildLogError', function () {
restrict: 'C', restrict: 'C',
scope: { scope: {
'error': '=error', 'error': '=error',
'entries': '=entries' 'entries': '=entries',
'isSuperuser': '<isSuperuser'
}, },
controller: function($scope, $element, Config) { controller: function($scope, $element, Config) {
$scope.localPullInfo = null; $scope.localPullInfo = null;
@ -40,9 +41,21 @@ angular.module('quay').directive('buildLogError', function () {
calculateLocalPullInfo($scope.entries); calculateLocalPullInfo($scope.entries);
$scope.isInternalError = function() { $scope.getInternalError = function(entries) {
var entry = $scope.entries[$scope.entries.length - 1]; var entry = entries[entries.length - 1];
return entry && entry.data && entry.data['internal_error']; if (entry && entry.data && entry.data['internal_error']) {
return entry.data['internal_error'];
}
return null;
};
$scope.getBaseError = function(error) {
if (!error || !error.data || !error.data.base_error) {
return false;
}
return error.data.base_error;
}; };
$scope.isPullError = function(error) { $scope.isPullError = function(error) {