none
How to ignore Web.Contents error on Power Query

    Question

  • How to ignore Web.Contents methos error on Power Query function ?

    Web.Contents make auth error on my Urls, sometime.
    I want to ignore auth error, and skip.

    Currently Power Query confirm collect auth information of web site, and cannot ignore.

    Regards,
    Yoshihiro Kawabata

    Wednesday, September 04, 2013 6:56 AM

Answers

All replies

  • Hi Yoshihiro,

    Are you trying to:

    1. Ignore the error and display whatever is on the webpage anyway
    2. Ignore the error and continue to run the mashup differently

    #1 is not supported, #2 can be done by wrapping with a try otherwise.

    Thanks,
    M.

    Monday, September 09, 2013 5:21 PM
    Owner
  • I try #1, #2.

    For example:
     2 site error in 1,000 site.
     2 site error reasons is maintenace, and set BASIC Auth mode for only administrator.
     I want Power Query ignore 2 site, and get 998 site Web.Contents. 

    Regards 

    Monday, September 09, 2013 10:20 PM
  • Hi Yoshihiro,

    Do you get top-level errors or error in some cells? (i.e. if you're using Web.Contents([URL]) as a custom column, where URL is another column in the table.

    If you get the errors at cell level, then you can use "Table.RemoveRowsWithErrors" library function to exclude the rows with errors in those columns.

    Thanks,
    M.

    Tuesday, September 10, 2013 5:52 PM
    Owner
  • Hi Migue,

    Dialog "Access Web Content" appear at Web.Contents([URL]),
    which [URL] need to BASIC Auth.
    I want to skip the URL without dialog.

    Regards,
    Yoshihiro Kawabata.

    Tuesday, September 10, 2013 11:03 PM
  • Is this still an issue?

    Thanks!


    Ed Price, SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)

    Answer an interesting question? Create a wiki article about it!

    Wednesday, September 18, 2013 8:38 PM
    Owner
  • No issue.

    Regards,
    Yoshihiro Kawabata
    Wednesday, September 18, 2013 10:38 PM
  • Um, yes, I have this issue.  I am calling a SOAP web service with Web.Contents, and if the input data is not correct, the web service returns a 500 error, ALONG WITH an error message in the response. How do I access the response, since PQ seems to do nothing if it gets an HTTP 500 error? This is a showstopper for an otherwise successful SOAP web service calling mechanism...

    Thanks,

    - Rand


    Rand Wrobel, Consultant

    Tuesday, July 21, 2015 4:52 PM
  • I'll try to write a sample tomorrow, but this can be done by using the ManualStatusHandling option on Web.Contents to say that you want to manually handle error 500. You will then get back the body of the error.
    Wednesday, July 22, 2015 3:16 AM
    Owner
  • Can this be done from Power query?

    I am trying the following for digest authntification:

    let
    Source = Web.Contents(URL, [Headers=[Authorization="Digest username=""USERNAME"", realm=""REALM"", nonce=""NOUNCE"", uri=""URI"", qop=auth, nc=, cnonce="""", response=""RESPONSE"", opaque="""""],
    ManualStatusHandling={401}]),
    ResponseMeta = Value.Metadata(Source),
    ResponseStatus = ResponseMeta[Response.Status]
    in
    ResponseStatus

    However, the ResponseStatus is null instead of HTTP 401 code I has expecting. I would like to be able to get the nounce and response values from the response header.

    Also: I am looking into creating a custom data connector to solve my issue. The following is posted in the other-topics.md for the DataConnectors docs on GitHub: "Note: Extensions are able to use the ManualStatusHandling option with status codes 401 and 403, which is not something that can be done in Web.Contents calls made outside of an extension context (i.e. directly from Power Query)."

    Can I achieve the digest authentication using power query or by creating a custom data connector?


    • Edited by SFBloo Tuesday, October 31, 2017 7:03 PM
    Tuesday, October 31, 2017 6:54 PM