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
|
# File 'lib/xnlogic/friendly_errors.rb', line 11
def self.with_friendly_errors
yield
rescue Xnlogic::XnlogicError => e
Xnlogic.ui.error e.message, :wrap => true
Xnlogic.ui.trace e
exit e.status_code
rescue Thor::AmbiguousTaskError => e
Xnlogic.ui.error e.message
exit 15
rescue Thor::UndefinedTaskError => e
Xnlogic.ui.error e.message
exit 15
rescue Thor::Error => e
Xnlogic.ui.error e.message
exit 1
rescue LoadError => e
raise e unless e.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
Xnlogic.ui.error "\nCould not load OpenSSL."
Xnlogic.ui.warn " You must recompile Ruby with OpenSSL support or change the sources in your \\\n Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \\\n using RVM are available at http://rvm.io/packages/openssl.\n WARN\n Xnlogic.ui.trace e\n exit 1\nrescue Interrupt => e\n Xnlogic.ui.error \"\\nQuitting...\"\n Xnlogic.ui.trace e\n exit 1\nrescue SystemExit => e\n exit e.status\nrescue Exception => e\n Xnlogic.ui.error <<-ERR, :wrap => true\n Unfortunately, a fatal error has occurred. Please see the XN Logic \\\n ZenDesk support pages: https://xnlogic.zendesk.com/hc/en-us\n ERR\n raise e\nend\n", :wrap => true
|