Giter Site home page Giter Site logo

AcmeException Doesn't Exist about acme-ps HOT 5 CLOSED

pkisharp avatar pkisharp commented on July 3, 2024
AcmeException Doesn't Exist

from acme-ps.

Comments (5)

glatzert avatar glatzert commented on July 3, 2024

Your fix hides the details - essentially (if you want to do something fancy), you'll need access to the Error-Details, which are available via $exception.Response.Content.
I created the neccessary fix and will provide them via the gallery in some days (there are more minor problems I, which should be addressed)

from acme-ps.

GeorgeSchiro avatar GeorgeSchiro commented on July 3, 2024

IMHO, the default behavior should be what is most helpful. Here's what I see with the "1.1.4" version of "AcmeHttpException":

New-ACMEOrder "C:\Users\admin\Desktop\tmp\AcmeState" -Identifiers $SanList

At C:\Users\admin\Desktop\tmp\ACME-PS\1.1.4\ACME-PS.psm1:1395 char:13
+             throw [AcmeHttpException]::new($respone.ErrorMessage, $re ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], AcmeHttpException
    + FullyQualifiedErrorId :

As you can see, no helpful feedback.

Here's what I see with the version of "AcmeHttpException" I posted above (2/1 comment)

New-ACMEOrder "C:\Users\admin\Desktop\tmp\AcmeState" -Identifiers $SanList

@{type=urn:ietf:params:acme:error:rateLimited; detail=Error creating new order :: too many certificates already issued for exact set of domains: ...: see
https://letsencrypt.org/docs/rate-limits/; status=429}
At C:\Users\admin\Desktop\tmp\ACME-PS\1.1.4\ACME-PS.psm1:523 char:9
+         throw "$($_message)`n$($_response.Content)"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (
@{type=urn:iet...s/; status=429}:String) [], RuntimeException
    + FullyQualifiedErrorId :
    @{type=urn:ietf:params:acme:error:rateLimited; detail=Error creating new order :: too many certificates already issued for exact set of domains: ...: see https://le
tsencrypt.org/docs/rate-limits/; status=429}

Here's what a troubleshooter needs to quickly understand and resolve the issue:

error:rateLimited; detail=Error creating new order :: too many certificates already issued

I think the "1.1.4" version is hiding details.

from acme-ps.

glatzert avatar glatzert commented on July 3, 2024

I see the problem.

Nevertheless throwing the error without the $response being attached to the object is good for "interactive", but not for automated environments.
You could for example automatically wait, if you got rateLimited, but that means, you have to access the error-type of the response.

I'm using throw for that, since I want to ensure the pipeline breaking.

So technically I need an Exception, which will stop the pipeline, can be handled with try {} catch {} AND will print a useful error message.

from acme-ps.

glatzert avatar glatzert commented on July 3, 2024

So - NORMALLY - an Exception.Message will be displayed as first line.
But I messed up $response.ErrorMessage, which simply does not exist - it's more or less a typo.

To conclude: I need to use $response.ErrorMessage as Message and I will add $response.Content.Details to the message, if it exists.

That'll make it readable for humans and usable for machines.

from acme-ps.

glatzert avatar glatzert commented on July 3, 2024

Fixed it, and will deploy it as 1.1.5 between monday and wednesday (will make us both happy ;))

from acme-ps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.