Skip to content

Commit 4a5249c

Browse files
committed
Rename custom error from Sass_Error to Error_Invalid
Avoids name-clash with C-API `Sass_Error` value type!
1 parent ded586f commit 4a5249c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

error_handling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Sass {
66

7-
Sass_Error::Sass_Error(Type type, ParserState pstate, string message)
7+
Error_Invalid::Error_Invalid(Type type, ParserState pstate, string message)
88
: type(type), pstate(pstate), message(message)
99
{ }
1010

@@ -31,7 +31,7 @@ namespace Sass {
3131

3232
void error(string msg, ParserState pstate)
3333
{
34-
throw Sass_Error(Sass_Error::syntax, pstate, msg);
34+
throw Error_Invalid(Error_Invalid::syntax, pstate, msg);
3535
}
3636

3737
void error(string msg, ParserState pstate, Backtrace* bt)

error_handling.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ namespace Sass {
1010

1111
struct Backtrace;
1212

13-
struct Sass_Error {
13+
struct Error_Invalid {
1414
enum Type { read, write, syntax, evaluation };
1515

1616
Type type;
1717
ParserState pstate;
1818
string message;
1919

20-
Sass_Error(Type type, ParserState pstate, string message);
20+
Error_Invalid(Type type, ParserState pstate, string message);
2121

2222
};
2323

parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,7 @@ namespace Sass {
23982398

23992399
void Parser::error(string msg, Position pos)
24002400
{
2401-
throw Sass_Error(Sass_Error::syntax, ParserState(path, source, pos.line ? pos : before_token, Offset(0, 0)), msg);
2401+
throw Error_Invalid(Error_Invalid::syntax, ParserState(path, source, pos.line ? pos : before_token, Offset(0, 0)), msg);
24022402
}
24032403

24042404
// print a css parsing error with actual context information from parsed source

sass_context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ extern "C" {
221221
try {
222222
throw;
223223
}
224-
catch (Sass_Error& e) {
224+
catch (Error_Invalid& e) {
225225
stringstream msg_stream;
226226
string cwd(Sass::File::get_cwd());
227227
JsonNode* json_err = json_mkobject();

sass_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ extern "C" {
143143

144144
copy_strings(cpp_ctx.get_included_files(1), &c_ctx->included_files, 1);
145145
}
146-
catch (Sass_Error& e) {
146+
catch (Error_Invalid& e) {
147147
stringstream msg_stream;
148148
msg_stream << e.pstate.path << ":" << e.pstate.line << ": " << e.message << endl;
149149
c_ctx->error_message = sass_strdup(msg_stream.str().c_str());
@@ -235,7 +235,7 @@ extern "C" {
235235

236236
copy_strings(cpp_ctx.get_included_files(), &c_ctx->included_files);
237237
}
238-
catch (Sass_Error& e) {
238+
catch (Error_Invalid& e) {
239239
stringstream msg_stream;
240240
msg_stream << e.pstate.path << ":" << e.pstate.line << ": " << e.message << endl;
241241
c_ctx->error_message = sass_strdup(msg_stream.str().c_str());

0 commit comments

Comments
 (0)