Class: Wip::ErrorInterpreter
- Inherits:
-
Object
- Object
- Wip::ErrorInterpreter
- Defined in:
- lib/wip/error_interpreter.rb
Overview
Translates raw WSLC error output into friendlier hints.
Constant Summary collapse
- RSYNC_MISSING =
Shells report a missing rsync as "rsync: not found", while the container runtime names the executable either before or after its own phrasing.
Regexp.union( /rsync: (?:command )?not found/i, /rsync[^\n]*executable file not found/i, /executable file not found[^\n]*rsync/i )
- VOLUME_LIMIT_REACHED =
Regexp.union( /0x8007000e/i, /too many mounted volumes/i, /マウントされているボリュームが多すぎます/ )
Instance Method Summary collapse
-
#initialize(architecture: Environment.new.architecture) ⇒ ErrorInterpreter
constructor
A new instance of ErrorInterpreter.
- #interpret(output) ⇒ Object
Constructor Details
#initialize(architecture: Environment.new.architecture) ⇒ ErrorInterpreter
Returns a new instance of ErrorInterpreter.
19 20 21 |
# File 'lib/wip/error_interpreter.rb', line 19 def initialize(architecture: Environment.new.architecture) @architecture = architecture end |
Instance Method Details
#interpret(output) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/wip/error_interpreter.rb', line 23 def interpret(output) case output when VOLUME_LIMIT_REACHED then when /pull access denied|insufficient_scope|authorization failed/i then when %r{no matching manifest for linux/(?:amd64|arm64)}i then when RSYNC_MISSING then end end |