Skip to content

Commit

Permalink
Change error_path to error_file
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Nov 17, 2014
1 parent 13ae611 commit 1ca88d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extern "C" {
char* error_json;
char* error_message;
// error position
char* error_path;
char* error_file;
size_t error_line;
size_t error_column;

Expand Down Expand Up @@ -208,15 +208,15 @@ extern "C" {
stringstream msg_stream;
JsonNode* json_err = json_mkobject();
json_append_member(json_err, "status", json_mknumber(1));
json_append_member(json_err, "path", json_mkstring(e.path.c_str()));
json_append_member(json_err, "file", json_mkstring(e.path.c_str()));
json_append_member(json_err, "line", json_mknumber(e.position.line));
json_append_member(json_err, "column", json_mknumber(e.position.column));
json_append_member(json_err, "message", json_mkstring(e.message.c_str()));
msg_stream << e.path << ":" << e.position.line << ": " << e.message << endl;
c_ctx->error_json = json_stringify(json_err, "\t");;
c_ctx->error_json = json_stringify(json_err, " ");;
c_ctx->error_message = strdup(msg_stream.str().c_str());
c_ctx->error_status = 1;
c_ctx->error_path = strdup(e.path.c_str());
c_ctx->error_file = strdup(e.path.c_str());
c_ctx->error_line = e.position.line;
c_ctx->error_column = e.position.column;
c_ctx->output_string = 0;
Expand All @@ -228,7 +228,7 @@ extern "C" {
msg_stream << "Unable to allocate memory: " << ba.what() << endl;
json_append_member(json_err, "status", json_mknumber(2));
json_append_member(json_err, "message", json_mkstring(ba.what()));
c_ctx->error_json = json_stringify(json_err, "\t");;
c_ctx->error_json = json_stringify(json_err, " ");;
c_ctx->error_message = strdup(msg_stream.str().c_str());
c_ctx->error_status = 2;
c_ctx->output_string = 0;
Expand All @@ -240,7 +240,7 @@ extern "C" {
msg_stream << "Error: " << e.what() << endl;
json_append_member(json_err, "status", json_mknumber(3));
json_append_member(json_err, "message", json_mkstring(e.what()));
c_ctx->error_json = json_stringify(json_err, "\t");;
c_ctx->error_json = json_stringify(json_err, " ");;
c_ctx->error_message = strdup(msg_stream.str().c_str());
c_ctx->error_status = 3;
c_ctx->output_string = 0;
Expand All @@ -252,7 +252,7 @@ extern "C" {
msg_stream << "Error: " << e << endl;
json_append_member(json_err, "status", json_mknumber(4));
json_append_member(json_err, "message", json_mkstring(e.c_str()));
c_ctx->error_json = json_stringify(json_err, "\t");;
c_ctx->error_json = json_stringify(json_err, " ");;
c_ctx->error_message = strdup(msg_stream.str().c_str());
c_ctx->error_status = 4;
c_ctx->output_string = 0;
Expand All @@ -264,7 +264,7 @@ extern "C" {
msg_stream << "Unknown error occurred" << endl;
json_append_member(json_err, "status", json_mknumber(5));
json_append_member(json_err, "message", json_mkstring("unknown"));
c_ctx->error_json = json_stringify(json_err, "\t");;
c_ctx->error_json = json_stringify(json_err, " ");;
c_ctx->error_message = strdup(msg_stream.str().c_str());
c_ctx->error_status = 5;
c_ctx->output_string = 0;
Expand Down Expand Up @@ -336,7 +336,7 @@ extern "C" {
c_ctx->error_message = 0;
c_ctx->error_status = 0;
// reset error position
c_ctx->error_path = 0;
c_ctx->error_file = 0;
c_ctx->error_line = -1;
c_ctx->error_column = -1;

Expand Down Expand Up @@ -549,7 +549,7 @@ extern "C" {
if (ctx->source_map_string) free(ctx->source_map_string);
if (ctx->error_message) free(ctx->error_message);
if (ctx->error_json) free(ctx->error_json);
if (ctx->error_path) free(ctx->error_path);
if (ctx->error_file) free(ctx->error_file);
if (ctx->input_path) free(ctx->input_path);
if (ctx->output_path) free(ctx->output_path);
if (ctx->image_path) free(ctx->image_path);
Expand All @@ -561,7 +561,7 @@ extern "C" {
ctx->source_map_string = 0;
ctx->error_message = 0;
ctx->error_json = 0;
ctx->error_path = 0;
ctx->error_file = 0;
ctx->input_path = 0;
ctx->output_path = 0;
ctx->image_path = 0;
Expand Down Expand Up @@ -615,7 +615,7 @@ extern "C" {
IMPLEMENT_SASS_CONTEXT_GETTER(int, error_status);
IMPLEMENT_SASS_CONTEXT_GETTER(const char*, error_json);
IMPLEMENT_SASS_CONTEXT_GETTER(const char*, error_message);
IMPLEMENT_SASS_CONTEXT_GETTER(const char*, error_path);
IMPLEMENT_SASS_CONTEXT_GETTER(const char*, error_file);
IMPLEMENT_SASS_CONTEXT_GETTER(size_t, error_line);
IMPLEMENT_SASS_CONTEXT_GETTER(size_t, error_column);
IMPLEMENT_SASS_CONTEXT_GETTER(const char*, output_string);
Expand Down
2 changes: 1 addition & 1 deletion sass_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const char* sass_context_get_output_string (struct Sass_Context* ctx);
int sass_context_get_error_status (struct Sass_Context* ctx);
const char* sass_context_get_error_json (struct Sass_Context* ctx);
const char* sass_context_get_error_message (struct Sass_Context* ctx);
const char* sass_context_get_error_path (struct Sass_Context* ctx);
const char* sass_context_get_error_file (struct Sass_Context* ctx);
size_t sass_context_get_error_line (struct Sass_Context* ctx);
size_t sass_context_get_error_column (struct Sass_Context* ctx);
const char* sass_context_get_source_map_string (struct Sass_Context* ctx);
Expand Down

0 comments on commit 1ca88d0

Please sign in to comment.