࿅ 6 d dl mZ d dlmZ G d de Z G d de Z G d de Z G d d
e Z G d de Z G d
de Z
G d de Z G d de Z G d de Z
G d de ZdS ) )gettext) WposErrorc ( e Zd ZdZdd fd
Z xZS )WebsiteCheckErrorz9
Generic base class for all website post checks.
N)detailsc t t | || || _ || _ || _ d S )N)messagecontext)superr __init__headerfix_tipr )selfr
descriptionr r
r __class__s &py/clwpos/user/website_check/errors.pyr zWebsiteCheckError.__init__ sL
&&// 0
)__name__
__module____qualname____doc__r
__classcell__r s @r r r sS JN r r c ` e Zd Z ed Z ed Z ed Z fdZ xZS )PostCheckRequestExceptionzHttp request failedz|Fatal error on attempt to request website main page: %(url)s. Error message: %(error)sz0Manually check website responds on http requestsc t t | | j | j t || | j d S )N)urlerrorr
r r
r )r r r HEADERMESSAGE_TEMPLATEdictFIX_TIP)r r r r s r r z"PostCheckRequestException.__init__" s_
'..77;- L 8
r r r r _r r! r# r r r s @r r r su
Q$
%
%Fq #$ $
a: G
r r c d e Zd ZdZ ed Z ed Z ed Z fdZ xZ 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.c t t | | j | j t || | j d S )N)r http_coder )r r' r r r! r" r# )r r r, r s r r z WebsiteCheckBadHttpCode.__init__> s_
%t,,55;-# L 6
r
r r r r r% r r! r# r r r s @r r' r' . s Q.
/
/Fq CD D
a 9 G
r r' c d e Zd ZdZ ed Z ed Z ed Z fdZ xZ 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.c t t | | j | j t || | j d S )N)r timeoutr )r r/ r r r! r" r# )r r r1 r s r r zWebsiteTimeout.__init__[ s^
nd##,,;- L -
r r- r s @r r/ r/ J s Q)
*
*Fq +, , a R G
r r/ c d e Zd ZdZ ed Z ed Z ed Z fdZ xZ 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.c t t | | j | j t | | j | d S N)r )r
r r
r r )r r3 r r r! r" r# r r r r s r r zWebsiteHttpsBroken.__init__x s_
$''00;- L 1
r r- r s @r r3 r3 g s Q)
*
*Fq 12 2 a C G
r r3 c d e Zd ZdZ ed Z ed Z ed Z fdZ xZ 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.c t t | | j | j t | | j | d S r5 )r r8 r r r! r" r# r6 s r r zWebsiteNotResponding.__init__ s_
"D))22;- L 3
r r- r s @r r8 r8 s Q*
+
+Fq 12 2
a 8 G
r r8 c : e Zd Z ed Zdef fdZ xZS )RollbackExceptionz+Action failed and rolled back. Here is why.reasonsc | d |D | _ t t | d d S )Nc
j g | ]0}t |j |j |j d |j |j 1S )
post_check)r
r r typer
r )r" r
r r r
r ).0reasons r