Announcement

Collapse
No announcement yet.

catching GetURLImage errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • catching GetURLImage errors

    The documentation says
    Description: This is the contents of the requested web page image. If an error occurs, the text "ERROR:" will be returned followed by a reason for the error .
    Code:
    Dim Snapshot1 As Object = hs.GetURLImage("http://" & CamUser & ":" & CamPassword & "@" & CamIP, CamPath, False, 80, Snapshot)
    But how do I write this error in the log file? The Snapshot1 variable is an object not a string.

  • #2
    You could check if it returned a string:

    Code:
    If Typeof Snapshot1 Is String Then hs.writelog("Camera Grab",Snapshot1)
    Last edited by sparkman; January 22nd, 2017, 01:07 PM.
    HS 3.0.0.548: 1976 Devices 1156 Events
    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

    Comment


    • #3
      Thanks for the tip it worked.

      I tried it this way
      Code:
       
       If Snapshot1.GetType Is GetType(String) Then
      But that didn't work out (probably because I didn't understand the syntax). But your suggestion is a lot easier to understand.

      Comment


      • #4
        Originally posted by alan_smithee View Post
        Thanks for the tip it worked.

        I tried it this way
        Code:
         
         If Snapshot1.GetType Is GetType(String) Then
        But that didn't work out (probably because I didn't understand the syntax). But your suggestion is a lot easier to understand.
        You're welcome! Glad it worked.

        Cheers
        Al
        HS 3.0.0.548: 1976 Devices 1156 Events
        Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

        Comment

        Working...
        X