Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Webservice Error Message

Forum

Search UsersRules
Webservice Error Message
#1
Active user
Points:: 0
Joined:: Apr 10, 2020

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

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

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;

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.