/
issue.rb
55 lines (49 loc) · 1.31 KB
/
issue.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module Y2Autoinstallation
module AutoinstIssues
# Base class for autoinstallation problems while importing the
# AutoYaST configuration file.
#
# Y2Autoinstallation::AutoinstIssues offers an API to register
# and report related AutoYaST problems.
class Issue
include Yast::I18n
# @return [String] Section where it was detected
attr_reader :section
# @return [Symbol] :warn, :fatal problem severity
attr_reader :severity
# Return problem severity
#
# * :fatal: abort the installation.
# * :warn: display a warning.
#
# @return [Symbol] Issue severity (:warn, :fatal)
# @raise NotImplementedError
def severity
@severity || :warn
end
# Return the error message to be displayed
#
# @return [String] Error message
# @raise NotImplementedError
def message
raise NotImplementedError
end
# Determine whether an error is fatal
#
# This is just a convenience method.
#
# @return [Boolean]
def fatal?
severity == :fatal
end
# Determine whether an error is just a warning
#
# This is just a convenience method.
#
# @return [Boolean]
def warn?
severity == :warn
end
end
end
end