Created
August 16, 2019 03:41
-
-
Save Akkiesoft/837908ae59822a3430888f1eafa5028a to your computer and use it in GitHub Desktop.
FiberErrorで死んだら次回起動時に一番目のアカウントでFiberErrorと投稿するプラグイン。core/pluginの中に入れて、bugreportより先に実行される必要がある。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create :a_fiber do | |
on_boot do |service| | |
begin | |
fiber if crashed_exception.is_a? Exception | |
rescue => e | |
# バグ報告中にバグで死んだらつらいもんな | |
error e end end | |
def fiber | |
b = "#{crashed_exception.class}" | |
Service.primary.post(:message => "#{crashed_exception.class}") if b == "FiberError" | |
end | |
def crashed_exception | |
@crashed_exception ||= object_get_contents(File.expand_path(File.join(Environment::TMPDIR, 'crashed_exception'))) rescue nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment