Merge pull request #1900 from koreader/houqp-master

write all error to crash.log
pull/1906/head
Frans de Jonge 8 years ago
commit 641d741ec4

@ -346,8 +346,8 @@ function ReaderUI:showReader(file)
end) end)
local ok, err = coroutine.resume(co) local ok, err = coroutine.resume(co)
if err ~= nil or ok == false then if err ~= nil or ok == false then
print '[!] doShowReader coroutine crashed:' io.stderr:write('[!] doShowReader coroutine crashed:\n')
print(debug.traceback(co, err, 1)) io.stderr:write(debug.traceback(co, err, 1))
UIManager:quit() UIManager:quit()
end end
end) end)

@ -40,7 +40,8 @@ function HorizontalGroup:paintTo(bb, x, y)
elseif self.align == "bottom" then elseif self.align == "bottom" then
widget:paintTo(bb, x + self._offsets[i].x, y + size.h - self._offsets[i].y) widget:paintTo(bb, x + self._offsets[i].x, y + size.h - self._offsets[i].y)
else else
print("[!] invalid alignment for HorizontalGroup", self.align) io.stderr:write("[!] invalid alignment for HorizontalGroup: ",
self.align)
end end
end end
end end

@ -242,7 +242,7 @@ logmsg "Starting KOReader . . ."
if [ "${FROM_KUAL}" == "yes" ] ; then if [ "${FROM_KUAL}" == "yes" ] ; then
eips_print_bottom_centered "Starting KOReader . . ." 1 eips_print_bottom_centered "Starting KOReader . . ." 1
fi fi
./reader.lua "$@" 2> crash.log ./reader.lua "$@" > crash.log 2>&1
# clean up our own process tree in case the reader crashed (if needed, to avoid flooding KUAL's log) # clean up our own process tree in case the reader crashed (if needed, to avoid flooding KUAL's log)
if pidof reader.lua > /dev/null 2>&1 ; then if pidof reader.lua > /dev/null 2>&1 ; then

@ -86,7 +86,7 @@ if awk '$4~/(^|,)ro($|,)/' /proc/mounts | grep ' /mnt/sd ' ; then
mount -o remount,rw /mnt/sd mount -o remount,rw /mnt/sd
fi fi
./reader.lua "${args}" 2> crash.log ./reader.lua "${args}" > crash.log 2>&1
if [ "${FROM_NICKEL}" == "true" ] ; then if [ "${FROM_NICKEL}" == "true" ] ; then
# start kobo software because it was running before koreader # start kobo software because it was running before koreader

@ -33,7 +33,7 @@ else
args="$@" args="$@"
fi fi
./reader.lua "$args" 2> crash.log ./reader.lua "$args" > crash.log 2>&1
if pidof reader.lua > /dev/null 2>&1 ; then if pidof reader.lua > /dev/null 2>&1 ; then
killall -TERM reader.lua killall -TERM reader.lua

Loading…
Cancel
Save