Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>

WEEK'S BEST

  • LiveStreet 0.5
  • Coppermine Photo G...
  • Projekktor Zwei 0....
  • SexyBookmarks 7.x-...
  • Reddit
  • easyReservations 1...
  • Content Rotator
  • BubblesJS 1.0
  • Social Media Mashu...
  • Chosen
  • Home > Scripts > Development Tools

    handleError

    Download button

    Downloads: 194  Tell us about an update
    User Rating:
    Rated by:
    Good (3.1/5)
    18 user(s)
    Developer:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    Yair Altman | More scripts
    Freeware 

    Windows / Linux / Mac OS / BSD / Solaris
    N/A
    Matlab
    October 2nd, 2007, 07:21 GMT
    C: \ Development Tools

     Read user reviews (0)  Refer to a friend  Subscribe

    handleError description

    handleError - A general-purpose error-handling function with an ability to register automatic cleanup actions

    handleError is a general-purpose error-handling function. The user can register cleanup actions that will automatically be activated in case of error. If an error occurred and handleError is called, then a hyper-linked stack-trace is displayed in the command window.

    Syntax:
    ERRMSG = handleError
    ACTIONIDX = handleError('register',ACTION)
    ERRMSG = handleError('unregister',ACTIONIDX)

    ACTIONIDX = handleError('register',ACTION) will register cleanup actions to be performed in case of error. ACTION may be a single string (e.g., 'msgbox(lasterr)') or a cell array with arguments for the sprintf function (e.g., {'set(%.19g,''Pointer'',''arrow'')',gcf}). The returned ACTIONIDX is the sequential cleanup action index.

    ERRMSG = handleError('unregister',ACTIONIDX) will perform and unregister cleanup action(s) ACTIONIDX. The returned ERRMSG is the last error msg.

    ERRMSG = handleError; will automatically perform and unregister any registered cleanup actions. Then, the last error message will be displayed in the Command Window, followed by a hyper-linked stack trace of that error. This format is the one that should be used within catch blocks (see Example):

    Example:
    try
    . cleanups(1)=handleError('register',{'set(%.19g,''Pointer'',''arrow'')',gcf});
    . cleanups(2)=handleError('register','disp(''finished processing!'')');
    . set(gcf,'Pointer','watch'); drawnow;
    . ... some complex computation ...
    . handleError('unregister',cleanups); %eval & unregister cleanup actions
    catch
    . handleError; %display error stack; eval & unregister cleanup actions
    end

    Compatibility:
    Created on Matlab 7, but should work on earlier versions too.

    Requirements:

    · MATLAB Release: R14SP3



    TAGS:

    handle Error | development tools | error tools | handle | Error | development



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM