Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Created August 16, 2019 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/837908ae59822a3430888f1eafa5028a to your computer and use it in GitHub Desktop.
Save Akkiesoft/837908ae59822a3430888f1eafa5028a to your computer and use it in GitHub Desktop.
FiberErrorで死んだら次回起動時に一番目のアカウントでFiberErrorと投稿するプラグイン。core/pluginの中に入れて、bugreportより先に実行される必要がある。
# -*- 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