File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,9 @@ bot.interaction_create do |event|
111111 SemanticLogger [ 'DiscordBot' ] . info ( 'Executing command' , command : command )
112112 result = Pyxis ::Cli . start ( command , { debug : true } )
113113 color = '#4caf50'
114+ rescue Pyxis ::MessageError => e
115+ result = e . message
116+ color = '#f44336'
114117 rescue Thor ::Error , Pyxis ::Error => e
115118 result = "#{ e . class } \n #{ e . message } "
116119 color = '#f44336'
Original file line number Diff line number Diff line change 77
88module Pyxis
99 Error = Class . new ( StandardError )
10+ MessageError = Class . new ( Pyxis ::Error )
1011end
1112
1213loader = Zeitwerk ::Loader . for_gem
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ class Components < Thor
1010 def info
1111 component_versions = ManagedVersioning ::ComponentInfo . new ( options [ :build ] ) . execute
1212
13+ raise Pyxis ::MessageError , 'This build does not exist' if component_versions . nil?
14+
1315 result = 'Versions of each component'
1416 component_versions . each do |component , version |
1517 result += "\n #{ component } : #{ version } "
Original file line number Diff line number Diff line change @@ -43,9 +43,14 @@ def self.enhance_faraday(faraday)
4343 json = response . body . blank? ? nil : JSON . parse ( response . body )
4444
4545 if json . is_a? ( Hash )
46- Thor ::CoreExt ::HashWithIndifferentAccess . new ( json )
46+ Thor ::CoreExt ::HashWithIndifferentAccess . new (
47+ {
48+ body : Thor ::CoreExt ::HashWithIndifferentAccess . new ( json ) ,
49+ response : response ,
50+ }
51+ )
4752 else
48- json || response
53+ response
4954 end
5055 end
5156 end
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ def execute
1515 pipeline = GitlabClient . client . get_json (
1616 "/api/v4/projects/#{ Project ::Reticulum . api_gitlab_path } /pipelines/#{ build_id } "
1717 )
18- reticulum_sha = pipeline . sha
18+ return nil if pipeline . response . status == 404
19+
20+ reticulum_sha = pipeline . body . sha
1921
2022 components = { }
2123
You can’t perform that action at this time.
0 commit comments