Handling ActionScript errors on Assert

Hello, I have a question that I can't seem to find an answer to anywhere online. In the old Google discussion group, someone asked the question regarding the problem I'm having. But no solution was ever posted.
I'm testing a method to make sure that a bad assertion shows up on the failed test list. However, when I run my TestRunner, I get an ActionScript pop-up instead of a failed test case. I'm just not sure how to suppress that error pop-up and show that a test case has failed. Any help would be greatly appreciated.
Here's a look at the code I'm running:
public function testGetDepartment():void {
var service:HTTPService = new HTTPService();
service.url = "getDepartmentByID.xml";
service.method = "GET";
service.resultFormat = "e4x";
service.addEventListener(ResultEvent.RESULT,
function(event:ResultEvent):void {
//Takes the XML response and "maps" it to a Dept. VO
var dept:Department = DepartmentMapper.getDepartment(event);
//This assertion works fine.
//assertEquals("Department Id is 45", 45, dept.deptId);
//This assertion is wrong and I want to fail.
assertEquals("Department Id is 45", 44, dept.deptId);
service.send();

Found the answer to my questions. It seems I needed to add the addAsync() method to handlers.

Similar Messages

  • FlashRemoting ActionScript Error

    Hello, I'm trying to use the Flash Remoting from Flash8 to
    access Java Stuff, But the action script in the .fla file always
    shoms me as an error:
    Code:
    import mx.remoting.*;
    // connect to the gateway server
    if (inited == null) {
    inited = true;
    NetServices.setDefaultGatewayUrl("
    http://localhost:8081/PrintService/gateway");
    gatewayConnnection = NetServices.createGatewayConnection();
    flashtestService =
    gatewayConnnection.getService("JavaPrinter", this);
    // call the service function getMessage()
    flashtestService.printTicket();
    // use _Result to have Flash call this function
    function printTicket_Result(result) {
    messageOutput.text = result;
    // use _Status to handle any errors
    function printTicket_Status(result){
    messageOutput.text = "status: " + result.details;
    myFile.fla Error:
    **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1:
    Syntax error.
    import mx.remoting.*;
    Total ActionScript Errors: 1 Reported Errors: 1
    The NetServices.as file is located at: C:\Arquivos de
    programas\Macromedia\Flash 8\en\First
    Run\Classes\mx\remoting

    Thanks it did solve the Script issue. But another problem
    came up... The Remoting cannot find the Java Service. Then I get
    this exception: status:
    flashgateway.adapter.NoSuchServiceException: No service named
    JavaPrinter is known to Flash Remoting MX.
    I'm using Tomcat on the 8081 port, the context name is
    PrintService and the Java Class is called JavaPrinter... The
    flashgateway.jar is in the lib directory.
    So there may be some mistake in the following code?
    NetServices.setDefaultGatewayUrl("
    http://localhost:8081/PrintService/gateway");
    gatewayConnnection = NetServices.createGatewayConnection();
    flashtestService =
    gatewayConnnection.getService("JavaPrinter", this);
    Every help is appreciated. Thanks
    Wilson

  • How to handle the #error in ssrs expression

    hi 
    Please any one help me to resolve this #error ,
    I have a calculated filed in that expression i given a if condition like below 
    data of column is coming like this 0 , 0.0 
    =IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/( Fields!Column1.Value)))
    how to handle the #error 
    Please let me know any one 

    Hi deepuk23,
    According to your description, when you use the IIF() function in the report you got some error,right?
    The issue can be caused by the column1 and column2 have different datatype, I assumed that one is integer and another is float, when the Column1 is 0 or null,  because IIF() function always evaluates both the true part and the false part, even
    though it returns only one of them, it will throw out the error. 
    To resolve the issue, you should use a nested IIF() function to avoid the zero-divisor in any rate like below:
    =IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/(IIF(Fields!Column1.Value=0,1,Fields!Column1.Value))))
    For more information, please refer to this article:
    FAQ: Why does the “Attempted to divide by zero” error still happen?
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • OpenScript ActionScript Error from Adobe Flash Player 9

    I get a popup ActionScript Error from Adobe Flash Player 9 when trying to record a Flex Tree object using OpenScript 9.2.1.0 Production. Specifically, I click on the Triangle that opens/closes the view of the child nodes underneath the parent node of a Tree. Initially, the triangle arrow already pointing down and the child node is already showing. When I click on the triangle, the node underneath goes up and disappears under its parent node and the traingle is then pointing to the parent node.
    When I click this triangle in Firefox without OpenScript recording, I don't get any errors, popups, or issues. It seems to work correctly. During OpenScript recording, the recording seems to crash with a popup that is titled "Adobe Flash Player 9" and has the text "An ActionScript error has occurred" with the following error message:
    Error: Unable to find automation method 'mx.events.TreeEvent' for class '[object OSAutomationClass]'.
         at mx.automation::AutomationManager/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:1680]
         at mx.automation.delegates.core::UIComponentAutomationImpl/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\core\UIComponentAutomationImpl.as:281]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::dispatchTreeEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:3334]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::onTweenEnd()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:2193]
         at mx.effects::Tween/endTween()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:524]
         at mx.effects::Tween/http://www.adobe.com/2006/flex/mx/internal::doInterval()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:565]
         at mx.effects::Tween$/timerHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:179]
         at flash.utils::Timer/_timerDispatch()
         at flash.utils::Timer/tick()
    I can click "Dismiss All" from the Adobe popup and Firefox isn't affected. Openscript doesn't appear to have any issues and the recording can be continued or stopped. It records the click on the tree and the "Dismiss All" from the popup both as "Click object("@id='main'") as type "web" instead of "flexFT".
    I am using OATS 9.2.1.0 with Firefox 3.6.17. I am testing a Flex 3.3 SDK built application. I installed the Adobe Flash Player 9 that came with the Flex SDK 3.3 before installing OATS.
    Any help on this issue is greatly appreciated.
    Some other information that may prove to be useful: I cannot seem to get OpenScript to consistently play back the actions on the same tree described above. Sometimes it works and sometimes it does not. I've tried using "Select Tree", "Select List", and "Click Tree" and each one is inconsistent on playback. It will report "Target Not Found".
    I have the console output for a "Target Not Found" failure below, where line 100 is ".select("GRID1>server1", TriggerEvent.Mouse," from the following Java generated on recording with OpenScript:
    flexFT
    .list(
    15,
         "/web:window[@index='0' or @title='My Title']/web:document[@index='0']/flex:application[@automationIndex='index:-1' and @label='' and @className='main' and @automationName='main' and @automationClassName='FlexApplication' and @id='main']/flex:canvas[@automationIndex='index:1' and @label='' and @className='mx.containers.Canvas' and @automationName='mainCanvas' and @automationClassName='FlexCanvas' and @id='mainCanvas']/flex:dividedBox[@automationIndex='index:16' and @label='' and @className='view.MainMediator' and @automationName='mediator' and @automationClassName='FlexDividedBox' and @id='mediator']/flex:accordion[@label='' and @automationName='index:0' and @id='null' and @automationIndex='index:0' and @className='mx.containers.Accordion' and @automationClassName='FlexAccordion']/flex:canvas[@automationIndex='index:1' and @label='My%20View2' and @className='view.my.MyNavigator' and @automationName='My%20View2' and @automationClassName='FlexCanvas' and @id='null']/flex:canvas[@label='' and @automationName='index:1' and @id='null' and @automationIndex='index:1' and @className='mx.containers.Canvas' and @automationClassName='FlexCanvas']/flex:list[@automationIndex='index:2' and @className='view.MyGridTree' and @automationName='index:2' and @automationClassName='FlexList' and @id='null']")
    .select("GRID1>server1", TriggerEvent.Mouse,
         KeyModifier.None);
    think(1.0);
    Console Output:
    11:29:09,093 INFO [EntryPoint] Started with arguments: -port 7777 -jwg C:\OracleATS\OFT\test06_ff\test06_ff.jwg
    11:29:09,250 INFO [EntryPoint] Received StartScriptEvent
    11:29:09,250 INFO [EntryPoint] Running "test06_ff" ...
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.flexFT.api.FlexFTService"
    11:29:09,484 INFO [1] Initializing VU 1 for script test06_ff
    11:29:21,546 INFO [1] Step: [1] Redirect (/Page1/)
    11:29:21,718 INFO [1] Step: [2] Login Page (/main.html)
    11:29:32,218 INFO [1] Step: [3] My Title (/main.html)
    11:30:11,453 ERROR [1] Error in section Run at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:11,453 ERROR [1] Iteration 1 failed at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:12,468 INFO [1] Finished VU 1 for script test06_ff
    Thanks,
    John

    I get a popup ActionScript Error from Adobe Flash Player 9 when trying to record a Flex Tree object using OpenScript 9.2.1.0 Production. Specifically, I click on the Triangle that opens/closes the view of the child nodes underneath the parent node of a Tree. Initially, the triangle arrow already pointing down and the child node is already showing. When I click on the triangle, the node underneath goes up and disappears under its parent node and the traingle is then pointing to the parent node.
    When I click this triangle in Firefox without OpenScript recording, I don't get any errors, popups, or issues. It seems to work correctly. During OpenScript recording, the recording seems to crash with a popup that is titled "Adobe Flash Player 9" and has the text "An ActionScript error has occurred" with the following error message:
    Error: Unable to find automation method 'mx.events.TreeEvent' for class '[object OSAutomationClass]'.
         at mx.automation::AutomationManager/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:1680]
         at mx.automation.delegates.core::UIComponentAutomationImpl/recordAutomatableEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\core\UIComponentAutomationImpl.as:281]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9156]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::dispatchTreeEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:3334]
         at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::onTweenEnd()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\controls\Tree.as:2193]
         at mx.effects::Tween/endTween()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:524]
         at mx.effects::Tween/http://www.adobe.com/2006/flex/mx/internal::doInterval()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:565]
         at mx.effects::Tween$/timerHandler()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\effects\Tween.as:179]
         at flash.utils::Timer/_timerDispatch()
         at flash.utils::Timer/tick()
    I can click "Dismiss All" from the Adobe popup and Firefox isn't affected. Openscript doesn't appear to have any issues and the recording can be continued or stopped. It records the click on the tree and the "Dismiss All" from the popup both as "Click object("@id='main'") as type "web" instead of "flexFT".
    I am using OATS 9.2.1.0 with Firefox 3.6.17. I am testing a Flex 3.3 SDK built application. I installed the Adobe Flash Player 9 that came with the Flex SDK 3.3 before installing OATS.
    Any help on this issue is greatly appreciated.
    Some other information that may prove to be useful: I cannot seem to get OpenScript to consistently play back the actions on the same tree described above. Sometimes it works and sometimes it does not. I've tried using "Select Tree", "Select List", and "Click Tree" and each one is inconsistent on playback. It will report "Target Not Found".
    I have the console output for a "Target Not Found" failure below, where line 100 is ".select("GRID1>server1", TriggerEvent.Mouse," from the following Java generated on recording with OpenScript:
    flexFT
    .list(
    15,
         "/web:window[@index='0' or @title='My Title']/web:document[@index='0']/flex:application[@automationIndex='index:-1' and @label='' and @className='main' and @automationName='main' and @automationClassName='FlexApplication' and @id='main']/flex:canvas[@automationIndex='index:1' and @label='' and @className='mx.containers.Canvas' and @automationName='mainCanvas' and @automationClassName='FlexCanvas' and @id='mainCanvas']/flex:dividedBox[@automationIndex='index:16' and @label='' and @className='view.MainMediator' and @automationName='mediator' and @automationClassName='FlexDividedBox' and @id='mediator']/flex:accordion[@label='' and @automationName='index:0' and @id='null' and @automationIndex='index:0' and @className='mx.containers.Accordion' and @automationClassName='FlexAccordion']/flex:canvas[@automationIndex='index:1' and @label='My%20View2' and @className='view.my.MyNavigator' and @automationName='My%20View2' and @automationClassName='FlexCanvas' and @id='null']/flex:canvas[@label='' and @automationName='index:1' and @id='null' and @automationIndex='index:1' and @className='mx.containers.Canvas' and @automationClassName='FlexCanvas']/flex:list[@automationIndex='index:2' and @className='view.MyGridTree' and @automationName='index:2' and @automationClassName='FlexList' and @id='null']")
    .select("GRID1>server1", TriggerEvent.Mouse,
         KeyModifier.None);
    think(1.0);
    Console Output:
    11:29:09,093 INFO [EntryPoint] Started with arguments: -port 7777 -jwg C:\OracleATS\OFT\test06_ff\test06_ff.jwg
    11:29:09,250 INFO [EntryPoint] Received StartScriptEvent
    11:29:09,250 INFO [EntryPoint] Running "test06_ff" ...
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.utilities.api.UtilitiesService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.browser.api.BrowserService"
    11:29:09,453 INFO [1] Initialized script service "oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.webdom.api.WebDomService"
    11:29:09,484 INFO [1] Initialized script service "oracle.oats.scripting.modules.flexFT.api.FlexFTService"
    11:29:09,484 INFO [1] Initializing VU 1 for script test06_ff
    11:29:21,546 INFO [1] Step: [1] Redirect (/Page1/)
    11:29:21,718 INFO [1] Step: [2] Login Page (/main.html)
    11:29:32,218 INFO [1] Step: [3] My Title (/main.html)
    11:30:11,453 ERROR [1] Error in section Run at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:11,453 ERROR [1] Iteration 1 failed at line (script.java:100). Target not found
    oracle.oats.scripting.modules.flexFT.common.api.internal.exceptions.FlexFTException: Target not found
         at oracle.oats.scripting.modules.flexFT.common.api.internal.utilities.FlexUtil.checkResults(FlexUtil.java:293)
         at oracle.oats.scripting.modules.flexFT.api.elements.AbstractFlexFTElement.replayEvent(AbstractFlexFTElement.java:99)
         at oracle.oats.scripting.modules.flexFT.api.elements.ListBase.select(ListBase.java:170)
         at script.run(script.java:100)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:325)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:717)
         at java.lang.Thread.run(Thread.java:619)
    11:30:12,468 INFO [1] Finished VU 1 for script test06_ff
    Thanks,
    John

  • "The document could not be opened. Bad file handle."  Error

    Greetings,
    I have many operators opening documentation using acrobat reader 8.1.2. When the documents are opened, sometimes a change has to be done to the file. I use computer management to "kick" everyone out of the files, update the .pdf, and then they can re-open the file to see the latest and greatest version. The problem is, if not everyone is out of the file, I sometimes get a ""The document could not be opened. Bad file handle." error, and have to usually wait a period of time before it will let anyone in. I think it has something to do with the windows temp files, but am unsure. It's hard to ensure everyone is out of the document on time, as up to 50 people may be in it at the same time.
    Is there perhaps a better way of publishing the new verison of the document?
    Thanks for any help you can provide!

    these two errors below is what I am receiving when do a program integrity scan: common program locations.
    I have done a repair on acrobat reader and I do have the two dll files I even put them in reader folder and still receiving the errors.
    missing file:"c:\program file\adobe\reader 8.0\reader\acrord32.exe"
    "c:\program files\adobe\reader 8.0\reader\acrord32.exe"cannot access a necessary file,"msvcp80.dll
    missing file:"c:\program file\adobe\reader 8.0\reader\acrord32.exe"
    "c:\program files\adobe\reader 8.0\reader\acrord32.exe"cannot access a necessary file,"msvcr80.dll

  • How to handle system errors in XI using BPM? please help!

    Hi Experts,
         I have a requirement where I have to handle system errors. For example when I am making RFC call using RFC adapter if the remote destination is down then I have create a understandable error message and store it in another SAP table.
    How to handle it? I am using BPM. I can see that there is "Exceptions" in the send step. How to use this?
    Thanks
    Gopal

    Hi Gopalkrishna,
    In this case whenever you get Mapping Exception , you can raise an Exception with the help of BPM and you can send the status to the RFC. But with the help of BPM.
    For a Simple case refer:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/4a773f12f14a18e10000000a114084/frameset.htm
    If you want you can do it without a BPM
    and throw an exception in case any of the values is missing:
    have a look at this weblog on how to throw exceptions
    in a nice way:
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    Also just go through <a href="/people/sap.user72/blog/2005/02/23/raising-exceptions-in-sap-xi-mapping Exceptions in SAP XI Mapping</a> and see if it helps you solve the problem.
    Also go through these links:
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7f2243d711d1893e0000e8323c4f/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/68/253239bd1fa74ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/f2bbc8142c11d3b93a0000e8353423/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/5d/2166e6a91d11d188de0000e8216438/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/05/bb223905b61b0ae10000000a11402f/content.htm
    Please do let know if it helped.
    Regards,
    Abhy

  • Error Handling and Error Messages

    I already posted this in the java programming forum, but I dont think the people responded understand patterns, or what I was asking. Here is my original post, for reference I am not asking how to catch and exception, or how to display an error, I am asking about the pattern implementation.
    I am currently in the process of creating my Exception model for my program, and I have a question about error messages. I was reading the book "Effective Java Programming" which deals with patterns and it states that an exception should state the error and report information on all relavent states. For instance If you have a class the modeled some sort of memory array, and an access was requested to a block of memory outside the array you should throw an ArrayIndexOutOfBoundsException("Index:" + index + ", start:" + 0 + ",end:" + Array.length) or if you made your own MemoryAddressOutOfBoundsException(same as above) which when printed should read
    ArrayIndexOutOfBoundsException: Index:-1, start:0, end:0
    stack trace
    The pertinate information is the index, start index, and end index.
    The book CLEARLY states as an industry design pattern that exceptions weather checked or unchecked should not contain user error messages. For instance with the above example one might be tempted to use this as the exception message: "The memory addres index is not a valid memory address." This is clearly a user error message.
    So heres my situation. In a gui environment (command line console not visible) how do you generated a user error message, letting the user know that an internal exception has occured.
    In my previous implementation of my project, I used the exception message the user error message and just reported the message on a dialog. I have heard of people using error catalogs, which centrallizes all the error messages into a single class or file.
    I was wondering if and Error catalog was a good approach, how I might go about implementing one, and if not how do you the community handle user error messages.

    class MyAppErrors {
       public static final int FILE_NOT_FOUND = 0;
       public static final int DIR_NOT_FOUND = 1;
       public stat final String[] errMsgs = {
          "The file was not found.",
          "The directory was not found.",
       public String getErrMsg( int n ) { return errMsgs[n]; }
    [\code]
    And a nicer version would allow the calling code to pass in a substring so you could say "The file 'somename.ext' was not found."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to Handle the error message?

    Hi,
    Can any one help me in handling the error messages in application,
    In my application, I am having 2 buttons, one is display button, and the other is reset button. When we enter wrong inputs, it prompts an error message and again we I click on reset button the application goes back to its normal stage i.e. the error message will be disappears. These things will happen in the same page. I have tryed to know the any Id/Name of error message.
    So please help to handle error and skip that error then continue execute raming code.
    Thanks
    Buntty

    A few problems with this question that need clarification:
    You're using a GUI, but we have no way of knowing which one -- Swing? AWT? SWT? other?
    You ask how to fix your program flow and logic but don't show us the current state. Most of us can't read minds so a bit of code would be nice here.
    You mention "Page". What context is this in?
    A great resource that has helped me and will probably help you is an article entitled [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html] . It will tell you how to formulate your questions so that the folks here will be better able to answer them. Good luck.

  • Handling Multiple Error Messages through EXIT_SAPMM06E_012 for ME28

    Dear Team,
                           After Executing ME28, system will give List of PO's that are to be Released . User will select Multiple  PO's and
    Press Release button in Application toolbar. once it is relased, User will press save Icon for all released PO's. 
    Once Save icon is presed, I need to  do  Validation for Multiple PO's in the user Exit EXIT_SAPMM06E_012 and capture my
    ErrorMessages for all Released PO's for which Validation fails.
    Here in the given user Exit, one PO will be processed at a time as PO is defined as Import Parameter but it will handle all PO's
    and give the output in status bar saying 'Relased Saved' for all PO's which succesfully gonethrough.
    once we execute ME28, system is showing list output with PO's to be Released(As system is handling with Write statments). In this case, we dont have scenario of PBO and PAI Modules( where user can correct error if any validation fails) like we have for ME22,etc.
    I have Written simpel Error Message in the  User Exit.
    once i tried to trigger my user exit  by Releasing and Saving with One PO, Error Message is displayed ( as information Message
    appears) and if i Press Exit button in Error Message, it is coming out of Transaction.
    Is there any Possibilty to Handle Multiple Error Messages ( in my case for  Valdiation Failed Po's)  in ME28 ,after Releasing and Saving , and also user should not come out of Transaction once  Error Messages are Displayed.
    Thanks and Regards
    Suresh

    Hi Suresh,
    there is a tekpo table to handle all po items. you can put it in loop and do validations.
    if any errors through, there may be a ex_messages table of type bapiret2.
    or
    try like this:  MESSAGE E368(00) WITH TEXT-001 TEXT-002.
    thanks
    srinu
    Edited by: srinu rao on Sep 22, 2009 3:43 AM

  • Error Handling - displaying Error on ALL error events

    I am trying to set up a global error handling page error.cfm so that whenever any error at all occurs I can display my error.cfm page.
    At first I tried the following in the application.cfm page, and then ran a page that tried to output a variable that did not exist, and it seemed to work:
    <cferror type = "EXCEPTION" exception = "any" template = "error.cfm">
    But then it just decided not to work, so I added these
    <cferror type = "REQUEST" template = "error.cfm">
    <cferror type = "VALIDATION" template = "error.cfm">
    Is there a way to make sure that all errors are handled? Am I right in putting all 3 of these in the application.cfm or do I need more (or less?)
    Thanks
    Mark

    It just didn't react to the error, by going to error.cfm, it just threw out the usual CF error as if I had not added CFERROR
    With those 3 statements in there is seems to work, but I wanted to make sure that no matter what error occurs it's going to hit the error.cfm

  • Actionscript error: HTTP request error

    Why do I get this kind of actionscript error? Everytime my page loads up this error immediately shows up:
    [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/trytryjfsjfs-debug/total.php" errorID=2032]. URL: http://localhost/trytryjfsjfs-debug/total.php"]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.2.0\frameworks\p rojects\rpc\src\mx\rpc\AbstractInvoker.as:220]
        at mx.rpc::Responder/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responder .as:53]
        at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AsyncR equest.as:103]
        at DirectHTTPMessageResponder/errorHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\ mx\messaging\channels\DirectHTTPChannel.as:362]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    I checked the said URL and this is my code of total.php:
    <?php
    $projName = mysql_real_escape_string($_POST["projNameTI"]);
    $query = "SELECT itemno, divno,descs,qty,unit,unitcost,qty*unitcost as subtotal, SUM(qty*unitcost) as total,psid,project_id FROM projectspecs
    Where project_id = (SELECT project_id FROM project where name='$projName')";
    $result = mysql_query($query) or die ("Query failed: ".mysql_error() ."Actual query: ". $query);
    ?>
    It seems that this code works perfectly
    Can someone please help me about this problem, just an explanation how to get this well.
    Hoping for a response.

    http://localhost/trytryjfsjfs-debug/total.php?projNameTI=3       (what ever you have as the id in the db.)
    try to use this URL in your browser and see what you are getting.

  • Error 2007 Some Actionscript error has occured

    I have tried the converter on a couple of modules that I have been working.  I have actually tried it on two differnet machines to make sure there wasn't something machine specific.  I am getting Error 2007 - Seom Actionscript error has occured.  Has anyone seen this?  Any idea what is casuing it? 
    I have just begun my exploration of the converted and this is my first couple of attempts so I could be doing somethign really obvious.
    This is a very basic simuation module with not much more than captions and click boxes.

    I've installed twice and always run as admin but same issue. If you hear anything else please let me know.
    Kerry Kuehn | Senior Vice President of Learning
    3333 East Camelback Road,  Suite 212
    Phoenix, AZ  85018
    602.840.1000 office
    816.695.3260 cell
    602.957.3057 fax
    [email protected]<mailto:[email protected]

  • Handling Oracle error messages

    I'm hoping this is a simple question.
    I have an updatable report I'm using to collect data. It's pretty vanilla - I just used the default templates. I have a unique index constraint on the form's underlying table. When I violate the constraint and attempt to save a row, I get redirected to what looks to be a default error page that isn't very user friendly.
    Can someone tell me how I can specify a different error message depending on the error number Oracle returns?
    Thanks for any info.

    The whole problem is divided in two parts: Exception is defined or not, I'll show you haow to handle exception that do not exist and want to trap them.
    I saw that there is no named exception for ORA error "-00054", which is raised when record is locked. So I define my exception as:
    busy_resource EXCEPTION;
      PRAGMA EXCEPTION_INIT(busy_resource, -00054);Now to handle this exception in the Appex process looks like:
    begin
      ...your code ...
      :PXX_msg := 'OK!';
    exception
      when busy_resource THEN
        :PXX_msg := 'Record is locked. Try later';
      when others then
        :PXX_msg := 'Unknown error!;
    end;where "PXX_msg" is hidden item acesable on the page, XX represent page number.
    And in "Process Error Message" part of process don't put anything because all errors are handled and error will never happened. If you want that part put in excepttion part "RAISE;" command so erro will be raised!!!
    And in "Process Success Message" of the same process put also:
    "&PXX_msg."
    So you can see the result in much pleasent way!
    You have the same variable as result and now all to do is imagine exceptions that could happened. For the first time allways try to put some logging in "WHEN OTHERS THEN" part top collect as much as possible errors that could happened.
    Hope this helps!

  • Handling Transport Errors in OSB Proxy Services

    Hi,
    I have a requirement of storing and handling Transport level Security Errors in my proxy services . In fact, my proxy services are secured with HTTP Basic Authentication and i am not able to catch authentication errors. I added a Service Error Handler to my proxy service but unfortunatly it doesn't handle these errors.
    Does anyone know how can we catch these errors in OSB, and if it is possible to execute activities like alerts, reports, logging in these cases.
    I read in some blogs that Error handlers are nested like this : Route Node ->  Proxy Service -> System Error Handler
    so maybe it would be good to customize the System Error Handler Behavior. I don't know if this is possible.
    Any help will be appreciated.
    Best regards
    Farouk

    Transport level authentication is done at transport layer even before the actual proxy service gets initiated. So you wont be able to catch authentication errors in the proxy service (and do alerting/logging/reporting etc). You can probably try enabling debug logging for HTTP protocol and see if you can capture these errors in the Access.log of the servers.    

  • How to handle write errors in non blocking sockets

    Hi,
    I'm using sockets registered with a Selector for read operations. I've seen code examples that put the SocketChannel in non blocking mode before registering it with the selector, and in fact not doing so would cause an IllegalBlockingModeException to be thrown.
    My problem is that I can't handle write errors. The call to write() returns inmediately without throwing any exception. Even worse, when the network timeout expires the selector wakes up and I get an exception on read(). So I can't tell the difference between a real read error and a write error.
    What can I do? Is there a magic method I haven't heard about?
    Thanks

    ejp wrote:
    OK, so what happens is this: you write from your ByteBuffer; if there is room in the socket send buffer, the data is transferred and the transfer count is returned. (If there isn''t, the write returns zero and nothing has happened.) Your application code then continues. Meanwhile TCP is trying to send the data in the send buffer and get an ACK from the peer. If the peer is down as per your test, eventually those write attempts will time out. You will then get a connection reset exception on the next read or write.
    Even worse, when the network timeout expires the selector wakes upCorrect, to tell you there is an error condition pending. This is good, not bad.You're right. This way my program can know that something happened.
    But I still don't understand what the difference between a failed write() and a failed read() is. I mean, the error condition may appear during a send attempt, or it may appear after sending. In both cases I get an error when trying to read. How can my program know if data have been received by the other end?
    Do I have to implement ACK messages in the application level protocol??? It'd be nice if TCP could do this for me...

Maybe you are looking for