Webservice Error Message

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Apr 10, 2020
Company: HerSüreçYazılım

Hello,
With the request from the web service, I create a warehouse transfer document with the code below (Picture-1). I only have a problem like this. After doing the post, if it fails, I can't catch the error message. I want to catch this error and send it back to the user via web service.

In summary, I want to capture error messages that I try from the frontend and come to the user's screen. (Picture-2)

Please help

 
#2
People who like this:0Yes/0No
Administrator
Rating: 23
Joined: Oct 3, 2019
Company:

Hello Ertugrul,

why did you comment out the command "try"? If you want to handle the error, then you need to use the following construction:

Code
   Try
      yourDocument.Write(DocumentWriteMode.Posting);
   Except
      Return Message(ErrorDescription());
   EndTry;

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.