࿅ 6ddlmZddlmZGddeZGddeZGddeZGd d eZGd d eZ Gd deZ GddeZ GddeZ GddeZ GddeZdS))gettext) WposErrorc(eZdZdZddfd ZxZS)WebsiteCheckErrorz9 Generic base class for all website post checks. N)detailsctt|||||_||_||_dS)N)messagecontext)superr__init__headerfix_tipr)selfr descriptionrr r __class__s &py/clwpos/user/website_check/errors.pyr zWebsiteCheckError.__init__sL &&// 0      )__name__ __module__ __qualname____doc__r __classcell__rs@rrr sSJNrrc`eZdZedZedZedZfdZxZS)PostCheckRequestExceptionzHttp request failedz|Fatal error on attempt to request website main page: %(url)s. Error message: %(error)sz0Manually check website responds on http requestsctt||j|jt |||jdS)N)urlerrorr rr r)r rr HEADERMESSAGE_TEMPLATEdictFIX_TIP)rrrrs rr z"PostCheckRequestException.__init__"s_ '..77;-L 8     r rrr_r r!r#r rrs@rrrsu Q$ % %Fq #$$ a:G          rrcdeZdZdZedZedZedZfdZxZ S)WebsiteCheckBadHttpCode Happens when we get unexpected status code from website. Usually user must go check logs and fix this issue himself. Bad http status code responsezUnsuccessful attempt to request website main page: %(url)s. Webserver responded with http status code %(http_code)s.aSearch your webserver logs for errors and manually check that WordPress site is working properly.ctt||j|jt |||jdS)N)r http_coder)r r'r r r!r"r#)rrr,rs rr z WebsiteCheckBadHttpCode.__init__>s_ %t,,55;-#L 6     r rrrrr%r r!r#r rrs@rr'r'.sQ. / /Fq CDD a 9G          rr'cdeZdZdZedZedZedZfdZxZ S)WebsiteTimeoutzE Happens when website does not respond in hardcoded timeout. zResponse timeout reachedzUnsuccessful attempt to request website main page: %(url)s. Webserver responds longer than %(timeout)s seconds (most likely it is not working).zMake sure that WordPress site is working properly and specified url gives response in %(timeout)s seconds. Search your webserver logs for errors that may cause the timeout issue.ctt||j|jt |||jdS)N)rtimeoutr)r r/r r r!r"r#)rrr1rs rr zWebsiteTimeout.__init__[s^ nd##,,;-L -     rr-rs@rr/r/JsQ) * *Fq +,, a RG          rr/cdeZdZdZedZedZedZfdZxZ S)WebsiteHttpsBrokenzM Happens when website has invalid or outdated https certificate. zBroken https certificatezUnsuccessful attempt to request website main page: %(url)s. Webserver redirected http request to https, but the last one does not have a valid certificate.ztMake sure that https certificate is valid and up to date or disable http to https redirection in your control panel.ctt||j|jt ||j|dSN)r)r rr rr)r r3r r r!r"r#rrrrs rr zWebsiteHttpsBroken.__init__xs_  $''00;-L 1     rr-rs@rr3r3gsQ) * *Fq 122 a CG          rr3cdeZdZdZedZedZedZfdZxZ S)WebsiteNotRespondingzF Happens when website does not have working webserver at all. zWebsite it not respondingzUnsuccessful attempt to request website main page: %(url)s. Webserver did not return any response.zqMake sure that webserver is working and your website is accessible: you can use `curl %(url)s` to check response.ctt||j|jt ||j|dSr5)r r8r r r!r"r#r6s rr zWebsiteNotResponding.__init__s_ "D))22;-L 3     rr-rs@rr8r8sQ* + +Fq 122 a 8G          rr8c:eZdZedZdeffd ZxZS)RollbackExceptionz+Action failed and rolled back. Here is why.reasonsc|d|D|_tt|ddS)Nc jg|]0}t|j|j|jd|j|j1S) post_check)r rrtyper r)r"r r rr r).0reasons r z.RollbackException.__init__..sU     }"N!        rrollback)r )errorsr r;r )rr<rs rr zRollbackException.__init__sO   $      &&// /CCCCCr)rrrr%r!rr rrs@rr;r;seq5 D!2 D D D D D D D D D Drr;c`eZdZedZedZedZfdZxZS)PhpLogErrorsFoundzWebsite server errorzhWe found some errors in the website log file: %(error_log_path)s. Here is some context: %(log_record)szuCheck found errors and decide whether they are critical or not. Contact your system administrator for help if needed.ctt||j|jt |||jdS)N)error_log_path log_recordr)r rGr r r!r"r#)rrIrJrs rr zPhpLogErrorsFound.__init__s_ &&//;--%L 0     rr$rs@rrGrGsx Q% & &Fq  a @G          rrGcdeZdZdZedZedZedZfdZxZ S)CDNActivationFailedzL Happens when website has invalid CDN configuration for some reason zCDN malfunctionzCDN feature was not activated properly. Changes were reverted and CDN module is now disabled. Event is logged to file: '%(logger_path)s' with stdout and stderr recorded.zActivate feature again. If the issue persists, ignore error and check your website configuration with enabled CDN feature. Contact your hoster's support for help.ctt||j|j|jt |dS)N) logger_path)r rrr )r rLr r r!r#r")rrNrs rr zCDNActivationFailed.__init__sS !4((11;-L[111 2     rr-rs@rrLrLsQ ! !Fq VWW a 3G         rrLcdeZdZdZedZedZedZfdZxZ S)JSCssCheckBadHttpCoder(r)ztUnsuccessful attempt to request website styles and scripts. Webserver responded with http status code %(http_code)s.r*ctt||j|jt ||jdS)N)r,r)r rPr r r!r"r#)rr,rs rr zJSCssCheckBadHttpCode.__init__s\ #T**33;-#L 4     rr-rs@rrPrPsQ. / /Fq CDDa 9G          rrPN)clwposrr%clwpos.cl_wpos_exceptionsrrrr'r/r3r8r;rGrLrPrrrUs  //////             1   ,     /   8     &   :     *   :     ,   6DDDDD DDD(     )   0     +   4     -     r