Forum

Author Topic: Catch API error messages  (Read 2489 times)

lenamat

  • Newbie
  • *
  • Posts: 10
    • View Profile
Catch API error messages
« on: March 22, 2016, 05:27:18 PM »
Hi,

Is there a way to catch the API's functions' error messages  that are sent to the console ? I know I can retrieve the full content of the console pane but I would like to catch the error messages as they come so that I can redirect the ones I want to a custom log file.

Many thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Catch API error messages
« Reply #1 on: March 22, 2016, 05:33:37 PM »
Hello lenamat,

In some cases you can use try: / except: concept to catch exceptions and act accordingly.
Best regards,
Alexey Pasumansky,
Agisoft LLC

lenamat

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Catch API error messages
« Reply #2 on: March 22, 2016, 06:31:59 PM »
Hi Alexey,

Thanks for the fast reply. I have already try to catch the potential exceptions raised by the API's functions but it doesn't seem to work...

For example if I try to launch the "Build dense cloud" function and my images are missing in the file hierarchy, no exception is being raised, even though I get the console message "can't load image: A:/B/C/Image.jpg". Can you think of another way to redirect these types of messages ?

Thanks!