Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Throw Exceptions from an AsyncTask

Comments in 'Plugin Development' started by aliuly, Mar 12, 2015.

  1. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Hello,

    I am writing a plugin that uses an AsyncTask. and as part of the error handling I want to throw an exception. Is this possible to do?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes but you won't be able to catch your exceptions from AsyncTask. Also it may be a little buggy.
  3. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    I just some more testing. Apparently creating new class instances (including an Exception class) would make the AsyncTask abort.

    Is this a PHP limitation or something to do with PocketMine?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP (pthreads)

Share This Page

Advertisement