File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed
Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change 33import importlib
44import os
55import sys
6+ import textwrap
67import time
78import traceback
89
@@ -100,6 +101,22 @@ def run() -> int:
100101 return 0
101102
102103
104+ def _error_message (exc : Exception ) -> None :
105+ err = '' .join (traceback .format_exception (exc ))
106+ error (err )
107+
108+ text = textwrap .dedent (
109+ """\
110+ Archinstall experienced the above error. If you think this is a bug, please report it to
111+ https://github.com/archlinux/archinstall and include the log file "/var/log/archinstall/install.log".
112+
113+ Hint: To extract the log from a live ISO
114+ curl -F 'file=@/var/log/archinstall/install.log' https://0x0.st
115+ """
116+ )
117+ warn (text )
118+
119+
103120def main () -> int :
104121 rc = 0
105122 exc = None
@@ -110,20 +127,11 @@ def main() -> int:
110127 exc = e
111128 finally :
112129 if exc :
113- err = '' .join (traceback .format_exception (exc ))
114- error (err )
115-
116- text = (
117- 'Archinstall experienced the above error. If you think this is a bug, please report it to\n '
118- 'https://github.com/archlinux/archinstall and include the log file "/var/log/archinstall/install.log".\n \n '
119- "Hint: To extract the log from a live ISO \n curl -F 'file=@/var/log/archinstall/install.log' https://0x0.st\n "
120- )
121-
122- warn (text )
130+ _error_message (exc )
123131 rc = 1
124132
125- sys . exit ( rc )
133+ return rc
126134
127135
128136if __name__ == '__main__' :
129- main ()
137+ sys . exit ( main () )
You can’t perform that action at this time.
0 commit comments