Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

HttpWebRequest GetResponse: The remote server returned an error: (500) Internal Server Error

(0) ShareShare
ReportReport
Posted on by 77
Hello Everyone,
 
i have an issue while consuming API in D365F&O when there are some data are incorrect there is no response in post man and it returens Internal sever error 500
when i try to handle this error in Dynamics by using Try and Catch the code doesn't go inside catch statement and it goes out the code and gives and error as info,
i'm trying to handle this error i tried catch(), catch(Exception::Error), catch(Exception::CLRError) also i made a variable of   System.Net.WebException ex; and tried catch(ex)
none of them are working the code doesn't get inside any catch of them ,, how can i handle that error in D365FO ?
  • Martin Dráb Profile Picture
    Martin Dráb 230,842 Most Valuable Professional on at
    HttpWebRequest GetResponse: The remote server returned an error: (500) Internal Server Error
    Please give us more information.
     
    What kind application programming interface (API) is it? A custom service?
     
    What is the type of the exception and where is it thrown?
     
    What is the transaction level? Note that exceptions can't be caught if transaction level isn't zero.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans