Use bridgeTalk with onError event, exception handling

Hi all,
I'm writting a function who use bridgeTalk to execute a photoshop script. This function works but I would like to throw an exception if the script has a problem. I commented a line in my script to have an exception but the onError event doesn't throw my Error.
Have someone an idea?
Thanks!
function save_to_PSD(obj){
    var bt = new BridgeTalk();
     bt.target = "photoshop";
     bt.body = save_to_psd_function.toSource()+"("+obj.toSource()+");";
     bt.onError = function(errObj) {
        // the next line display the error in the console
        $.writeln(errObj.body);
        // PROBLEM this error is never throw
        throw new Error (errObj.body);
     bt.send(100);
function save_to_psd_function(serializedObject){
    app.displayDialogs = DialogModes.NO;
    var obj = eval(serializedObject);
    var file_path = decodeURI(obj.file_path);
    // this will generate an exception
    //var img_file = new File(file_path);
    var ps_doc = app.open(img_file);
    psdSaveOption = new PhotoshopSaveOptions();
    psdSaveOption.embedColorProfile = true;
    app.activeDocument.saveAs(img_file, psdSaveOption, true, Extension.LOWERCASE);
    ps_doc.close();
    app.displayDialogs = DialogModes.ALL;

Hi all,
I found this solution if it can be helpfull for someone.
But I don't know if it is the better way. I'm not abable to run a new exception in the onResult function.
function save_to_PSD(obj){
    var error = null;
    var bt = new BridgeTalk();
     bt.target = "photoshop";
     bt.body = save_to_psd_function.toSource()+"("+obj.toSource()+");";
     bt.onError = function(ex){
        error = ex.body
     bt.send(100);
     if(error != null){
        throw new Error(error);

Similar Messages

  • Generalised Event Exception Handler

    Hi all experts,
    Can anybody plz tell how to create a generalised Exception Handler , so that wenever a exception is generated in the main method the Exception Event Handler shud be initialised to catch the exception for all the exceptions generated at runtime.
    I want the Exception Event Handler to catch the exceptions for RFC BAPI,EJB Webservice,etc..as i am using this in my application to give general message at runtime if any exceptions is generated from the try-catch block.
    Waiting for the reply.
    Regards:
    SK

    Hi SK,
    There is a general Exception that you can use for all exceptions thrown.
    just add this code for any exception you want to catch.
    try
        // try anything
    catch(Exception e)
       // catch any exception
    Regards,
    Marshall.

  • Problems using BridgeTalk with CS6

    I'm working on a project that involves a CS panel extension that happens to utilize the BridgeTalk library to send commands to different CS applications. This project builds fine in Flash Builder 4.5 that comes with CS 5.5. But updating to Flash Builder 4.6 from CS6, I now am unable to build the project (in CS6). Specifically because BridgeTalk appears to be missing.
    I use the following import line in my code to use BridgeTalk:
    import com.adobe.csawlib.misc.BridgeTalk
    The "misc" class is missing from "csawlib" so BridgeTalk isn't available.
    If anyone knows if BridgeTalk has been depracated for CS6 or if it needs to be used in a different manner, that would be amazing?
    Any help would be deeply appreciated.
    Thanks.
    - Derek

    This forum ("Forum comments") is for discussing forum issues, not product issues.
    I have no idea what BridgeTalk is; you may get answers if you ask in the Creative Suite forums.

  • Using partitions with published events

    I am testing the use of partitions for published events (from external application into InterConnect). To improve performance, I have modified the environment from using 1 FTP adapter to 2 FTP adapters that share the same settings (same application in iStudio, same ftp server settings in adapter.ini) except they are dedicated to a given event (partition in adapter.ini). The partitions have been created in iStudio and both adapters are visible in the "push metadata".
    The problem I encounter is that nothing prevents the FTP adapter from picking up the files from the remote ftp server. When the adapter picks up a file (D3L mode) that pertains to an event of the other partition (adapter), it fails with the RuntimeException "There is no OAI message for the Object that you are trying to send which satisfies all of the event map conditions." and the file is moved to the error directory and lost for the other right adapter.
    I can of course configure the 2 adapters to read files from dedicated directories on the ftp server but then what is the benefit compared to configuring 2 applications in iStudio. Did I miss something? Anyone using partitions?
    thanks,
    Claude

    Did you try to not configure the error directory ?
    rgds

  • Urgent:Using Tooltip with onmouseover event.

    I have about 1000 dynamically generated hyperlinks in my web
    page. And on the mouse over i am calling a tooltip constructor. But
    here the problem is.. when i hover the mouse on the hyper link for
    the first time it doesnt show the tooltip. From the second
    mouseover onwards it shows on.
    Something like this:
    <body>
    <a href=# onmouseover=abc() id=myId>clickhere</a>
    <div id="test"><div>this is the
    tip</div></div>
    <script>
    function abc()
    var a = new Spry.Widget.Tooltip("test","#myId");
    </script>
    </body>

    That is because when you hovered over the click here you only
    initialized the tooltip. Than Spry Tooltip adds a onmouseover event
    on your element. So you hover over it again and it shows the
    tooltip.
    I don't really understand why you would wanna do it that way,
    could you explain what you are trying to do here?

  • Exception Handling in Web Center for UI related Errors not working.

    Hi Guys,
    I have implemented Error Handling in ADF Application with Custom Model Exception Handler ( which is "CustomExceptionHandler extends DCErrorHandlerImpl") to catch all Model Layer Exception and to customize those error messages.
    I have implemented Error Handling in ADF Application with Custom View Exception Handler ( which is "CustomViewErrorHandler extends oracle.adf.view.rich.context.ExceptionHandler";) to catch all View Layer Exception and to customize those error messages.
    The design for this is , in Model Custom Exception Handler i find the exception message in "public String getDisplayMessage(BindingContext bindingContext,Exception exception) " method and throw RuntimeException to pass this exception to Custom View Layer Exception , so that i can handle all the exception @ View Layer it self .
    In the View Layer Exception Handler i am navigating to specific error page using
    String contextPath = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getContextPath();
    ExternalContext ectx = facesContext.getExternalContext();
    ectx.redirect.
    All these things absolutly working in ADF Application for all the exception ( Model , View ) and i am successfully navigating to error page.
    Problem  :
    When i implement the same thing in Webcenter Application ( Model Custom Exception Handler and View Custom Exception Handler), Model Part is working as expected , but View Custom Exception Handler is not all calling .
    i am assuming that ,this View Custom Exception Handler (CustomViewErrorHandler extends oracle.adf.view.rich.context.ExceptionHandler) works only for JSF Life cycle
    "Allows frameworks to intercept otherwise unhandled exceptions thrown during the JSF lifecycle. ExceptionHandlers can be registered by adding a service file with a class name at META-INF/services/oracle.adf.view.rich.context.ExceptionHandler." from http://jdevadf.oracle.com/adf-richclient-demo/docs/apidocs/oracle/adf/view/rich/context/ExceptionHandler.html";
    As Webcenter Portal uses ADF Life Cycle this Exception Handler is not calling , i am not sure.
    if any one has any idea please let me know .
    Thanks
    Annapareddy Srinivasrao
    Edited by: Srinivasrao Annapareddy on May 22, 2013 12:06 PM

    i used runtime exception along with the wdwsmodel exception

  • Exception handling in ODI - common exception handling framework

    Hi,
    I need to come up with a common exception handling framework in an environment where ESB and ODI are being used for interfacing and ELT operations. I am of the opinion that
    1. I am not able to find any documentation wrt exception handling when ODI is used? Can some one help me with some pointers?
    2, When I come up with a common exception handling framework using BPEL, will I be able to invoke the same from ODI.
    Thanks,
    Mahesh

    Thanks for the reply Allan. I haven't used BusinessWorks.
    I did go through this thread before and here's my understanding.
    1. ESB provides the ability of error handling (client management API) but not the exception handling i.e. I can't redirect the flow in case there is an exception in my primary flow. Am I right with my understanding?
    2. Error handling ability of ESB is limited to retryable exceptions viz-a-viz asynchrounous ESB processes (e.g. database listener not up) where in the process can be retried. Am I right here?
    Thanks,
    Mahesh

  • Exception handling - Common exception handling framework

    Hi,
    I need to come up with a common exception handling framework in an environment where ESB and ODI are being used for interfacing and ELT operations. I am of the opinion that
    1. A generic exception handling framework can be built using BPEL and can be invoked from ESB. Is my understanding correct?
    2. Are there any ways that we can build this framework using ESB itself? I opinion that it's not possible as there is no concept of try-catch?
    3. I am not able to find any documentation wrt exception handling when ODI is used? Can some one help me with some pointers?
    4, When I come up with a common exception handling framework, will I be able to invoke the same from ODI.
    Thanks,
    Mahesh

    Thanks for the reply Allan. I haven't used BusinessWorks.
    I did go through this thread before and here's my understanding.
    1. ESB provides the ability of error handling (client management API) but not the exception handling i.e. I can't redirect the flow in case there is an exception in my primary flow. Am I right with my understanding?
    2. Error handling ability of ESB is limited to retryable exceptions viz-a-viz asynchrounous ESB processes (e.g. database listener not up) where in the process can be retried. Am I right here?
    Thanks,
    Mahesh

  • Generic Exception Handler/Listener

    All,
    I have a web application and I want to create a generic exception handler/listener which will listen to all the exception(checked and runtime) which are thrown by web application.
    Any idea how can I do this?
    Regards.

    797836 wrote:
    Hi,
    I want to build a generic exception handler which can be reused in any java j2ee applications. Unlikely. Probably impossible.
    I have java application which is communicating with other 3rd party applications like webservices, webmethods , etc from where we are getting an errorcode which will be used in our java application to do a lookup to get the respestive error message from the resource bundle. Please clarify in such case how I can go with a generic exception handler which will be build separately and will be integrated with Java applications to handle the exceptions and errors.An excellent example of why a universal exception handler wouldn't work.
    At some point a call tree looks like A->B->C, where C (or beyond) that is where your communications problem occurs. The impact of that depends on the application.
    For example if a user types in a url (at A) and the server (C) fails to resolve it then that is a user problem.
    However if nightly batch process expects to download an update file every night from one location and it can't connect then that is an operations error (or notification/alert.)

  • Exception handling in Custom Login procedure

    Hi,
    I have a custom login procedure. Now instead of handling the possible exceptions in a custom way too, I want to use the syntax of the exception handling API (probably the one in the PDK) the default login procedure uses. Can someone point me to the values the default login procedure uses?
    Thanks, Tony

    Tony,
    The default login page (the source of which is now unwrapped in 3.0.0), uses the following snippet of code to report the errors:
    if p_error then
    wwerr_api_error_ui.show_inline_html;
    end if;The errors are stacked when the ls_login procedure is executed, and the next time the login page is called up, it just displays the stacked errors.

  • Sync Send without a Exception Handler ??

    hi..
    Can a synchronous send step work with out an exception handler..??
    im gettin my messages and combinin then n sendin via the sync send to call rfc , followeed by a send back to my server..
    at this very stage it expects me to define a handler for the same for the sync send.
    regards,
    vishal

    hi bhavesh..
    im doin the same...
    Mode : Synch
    Request Message
    Response Message
    Receiver From : Send Context
    any reason fr it dmandin fr an exception handler../
    it tch details i see the error as "no handler defined for this system exception"..
    any inputs..

  • Using Datasource with Toplink

    Hi,
    I am using toplink 10.1.3 .We are using the datasource to connect to weblogic connection pool.
    My session.xml is like this:
    - <login xsi:type="database-login">
    <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
    <user-name />
    <datasource>jdbc/ds</datasource>
    </login>
    In the java DAO part,I need a physical database connection to get the ArrayDescriptor.The part of java code is below
    java.sql.Connection dbconnection=null;
    DatabaseLogin login = serverSession.getLogin();
    dbconnection=(java.sql.Connection)login.connectToDatasource(null);
    Questions:
    1.Is the above correct way to get the Physical JDBC connection from a weblogic connection pool(configured using datasource).
    2.How will the Connection released to the pool?Should i use dbconnection.close() or clientSession.release().
    Thanks

    Thanks doug for your reply.
    I am using datasource to connect to the weblogic 9.2 connection pool.
    My specific use case is this.
    I am executing a Stored procedure which will takes a Oracle user defined data type as an Input paramater.
    some steps we use in the java code for the above use case.
    --Getting the  toplink session
    ServerSession serverSession = TopLinkGenericDAO.getSession();
    clientSession = serverSession.acquireClientSession();
    --For getting the oracle user defined array
    java.sql.Connection dbconnection=null;
    DatabaseLogin login = serverSession.getLogin();
    dbconnection=(java.sql.Connection)login.connectToDatasource(null);
    oracle.sql.ArrayDescriptor descriptor = new oracle.sql.ArrayDescriptor(
    "STRING_ARRAY", dbconnection);
    oracle.sql.ARRAY arr_ORCL = new oracle.sql.ARRAY(descriptor,
    dbconnection, aIncl_Vin);
    --for executing stored procedure
    StoredProcedureCall call = new StoredProcedureCall();
    DataReadQuery dbquery = new DataReadQuery();
    call.setProcedureName(CVeITDAOConstants.INSERT_PING);
    call.addNamedArgumentValue("para1", arr_ORCL );
    dbquery.setCall(call);
    --release connection in the finally block
    finally
    clientSession.release();
    dbconnection.close();
    The above code fails when we execute it for 150 concurrent connection(using JMeter) with connection fail exception.
    Please let me know how do i release the physical jdbc connection(dbconnection) in the finally block.
    do we need to give dbconnection.close() or just by giving clientSession.release() will also release the jdbc connection.
    Thanks.

  • Resume process instance after exception handling with an event subprocess

    We have a process with several automatic activities so we implement an event-based subprocess to catch any exception that occurs in the process.
    Since the error event is an interrupting event, how could we control the exception and resume the process where it was?
    BPM version 11.1.1.7
    Any suggestion?
    Thank you

    Know this isn't the answer you are looking for, but the answer to this gets much better in 12c where you can go back into the process after catching an exception in an event subprocess.
    In 11g however, once you catch an exception in an event subprocess you cannot go back where you left off in the main process.
    These are not great options I know, but here are a couple things I've seen to work around this:
    Exception error events in event subprocesses are always interrupting so one solution would be to instead use boundary events on the individual activities where the exceptions will occur.  Know you know this, but the down side of this is that it makes your process incredibly cluttered with boundary events.
    Catch the error in the event subprocess -> handle the cause of the exception -> exit the process -> invoke the process again.  The problem with this is that you would not be starting where you left off and where the error occurred.  You could work around this by having an exclusive gateway that directed it to the right activity in the process.
    Dan

  • Exception Handling (in Mapping) with out using BPM

    Hello All,
    We are on SP17. I have a simple flow involving XI
    JMS -> XI (Message Mapping -> XSL Mapping)  -> Mail
    I would like to send an email if there is an exception in any of the mapping. But I <b>don't want to use a BPM</b> for this exception handling. How can I do it?
    Thanks
    Abinash

    Hi Abinash,
    yes you can! See these..
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/sap.user72/blog/2005/02/23/raising-exceptions-in-sap-xi-mapping
    All the best!
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • How to use a timer together with an event.

    Dear All,
    Today I tried all day to accomplish someting with labview, but I didn't succeed. Perhaps you can help me.
    The problem is as follows. 
    I have an event structure inside a while loop. The events are all triggered by booleans. Those booleans initiate
    for instance some pumps or  other apparatus. The time-out is put at 200ms and inside the time-out structure 
    are some GET function (for instance to obtain the values of some balances and to do some calculations with those obtained values.
    Now I would like to be able to start an experiment. This means by pressing a boolean initiate the experiment. This experiment involves 
    the starting of a timer and after every 10 minutes, the obtained/calculated data (from the time-out) structure should be written to a .xls file.
    I'm not able to programm this part of the program. My first problem is that I need an event (triggered by a boolean) that start a timer. This timer should run always (independant of other events) until stopped by another boolean. After every 10 minutes this timer should initiate (with a boolean?) the data writing to a .xls file.  Can this be done by resetting the timer after every writing event?
    So I have multiple questions, but my main question is how to build an event which is trigger by a boolean and then initiates an overall timer.
    Thanks! 
    Bio

    OK.  That worked.
    You have made all the mistakes self-taught beginners with LabVIEW make, except that you apparently have a pretty good idea of what you want your program to do.
    1.  LV is a dataflow language.  This means that any node which has all its inputs satisfied can run and once started any node runs to completion before another starts.  In your event case the timeout case will execute 200 ms after the loop starts (assuming the user did not push a button before that).  The Waits in the sequence frames mean it will be at least 555 ms before the timeout case completes.  200 ms later is will run again, if not other event has occurred.  Furthermore, you do not know whether the Waits will run before or after the other code in each od the sequence frames because there is no data dependency between the Waits and that other code.
    2. A matter of style: It is recommended that front panels and block diagrams do not exceed one screen size.
    3. Local variables violate the dataflow paradigm and are almost always unnecessary.  The WIRE is the variable.  Connect things via wires not local or global variables.  You will also need some shift registers.
    4. Sequence structures are almost never required.  One exception: Single frame structures around something like the Wait function which does not have error clusters for dataflow.
    5. Look at the Producer/Consumer Design Patterns which come with LV.  File >> New.. >> VI >>  From Template >> Frameworks >> Design Patterns..  The events version will be useful.  Also learn about state machines.  That architecture is versatile, powerful, adaptable, and much more likely to get you to where you need to be with your program.
    6. The events will all be queued up in the internal event queue.  It just takes a long time for your program to get to them.  I like to keep the code in every event case simple enough that it executes before the user could get to the next button. The queued message handling in the Producer/Consumer takes care of this.
    7.  You probably should have an event for Stop experiment.  It would send a command to the consumer loop to shut down all pumps, close files, and any other "cleaning up" which needs to be done before stopping the program.
    This may seem like a lot, but you have most of the pieces.  Some re-arrangement and re-organization will help a lot.
    Lynn 

Maybe you are looking for

  • 24" iMac Video Card difference

    Hello, Is there a noticeable difference between the NVidia 128mgs and 256mgs cards - specifically while gaming - as to how the graphics show on the screen? Thanks. Jen

  • Display value at the end of timeline range selection

    I need to design Power View Report for which Date will act as "Timeline", so when I select DAte as "2010-10-01" to "2010-11-01" then It should show me report having data on "2010-11-01 because it is latest data value that I am having.

  • How can i set resolution for monitor

    The maximum resolution for my monitor is not shown in the preferences. How can I make my macBook Pro use the display in the highest resolution.

  • How do I delete photos from iPhoto

    I want to delete "crap" photos from iPhoto, ones that quite simply are "*****". How do I get rid of them once and for all. I notice I can do command delete and they go to the garbage I empty garbage and they are gone. The problem is that when I go ba

  • Alphabetizing vectors

    Does java have a class that alphabetizes strings? Say I had a list of 20 words, can I run those through a built in method? If not, can someone loan a "black box" alphabetizing algorithm? A algorithm that did numbers would get extra dukes! Thanks!