]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/error/Detail.cc
2c49241b9d0dae9f4b10eb761b9f9045346a5bb3
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 #include "error/Detail.h"
11 #include "HttpRequest.h"
12 #include "sbuf/SBuf.h"
13 #include "sbuf/Stream.h"
15 /// details an error by tying it to a uniquely named circumstance
16 class NamedErrorDetail
: public ErrorDetail
19 // convert from c-string to SBuf to simplify creation and optimize usage
20 /// \param aName must not contain characters that require quoting in access logs or HTML
21 explicit NamedErrorDetail(const char *aName
): name(aName
) {}
24 virtual SBuf
brief() const override
{ return name
; }
25 virtual SBuf
verbose(const HttpRequestPointer
&) const override
{ return name
; }
28 /// distinguishes us from all other NamedErrorDetail objects
35 operator <<(std::ostream
&os
, const ErrorDetail
&detail
)
42 operator <<(std::ostream
&os
, const ErrorDetail::Pointer
&detail
)
51 /* NamedErrorDetail */
54 MakeNamedErrorDetail(const char *name
)
56 return new NamedErrorDetail(name
);