]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/sbuf/Exceptions.cc
2 * Copyright (C) 1996-2018 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 "sbuf/Exceptions.h"
11 #include "sbuf/OutOfBoundsException.h"
12 #include "sbuf/SBuf.h"
14 OutOfBoundsException::OutOfBoundsException(const SBuf
&throwingBuf
,
16 const char *aFileName
, int aLineNo
)
17 : TextException(NULL
, aFileName
, aLineNo
),
18 theThrowingBuf(throwingBuf
),
21 SBuf
explanatoryText("OutOfBoundsException");
23 explanatoryText
.appendf(" at line %d", aLineNo
);
24 if (aFileName
!= NULL
)
25 explanatoryText
.appendf(" in file %s", aFileName
);
26 explanatoryText
.appendf(" while accessing position %d in a SBuf long %d",
27 pos
, throwingBuf
.length());
28 message
= xstrdup(explanatoryText
.c_str());
31 OutOfBoundsException::~OutOfBoundsException() throw()
34 InvalidParamException::InvalidParamException(const char *aFilename
, int aLineNo
)
35 : TextException("Invalid parameter", aFilename
, aLineNo
)
38 SBufTooBigException::SBufTooBigException(const char *aFilename
, int aLineNo
)
39 : TextException("Trying to create an oversize SBuf", aFilename
, aLineNo
)