Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/JsError.cpp

Issue 29810586: Issue 6526 - Use the maybe version of Compile() and Run() (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Don't have a different error type. Created June 19, 2018, 5:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/JsError.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 26 matching lines...) Expand all
37 error << *v8::String::Utf8Value(isolate, message->GetScriptResourceName()); 37 error << *v8::String::Utf8Value(isolate, message->GetScriptResourceName());
38 error << ":"; 38 error << ":";
39 auto lineNumber = message->GetLineNumber(isolate->GetCurrentContext()); 39 auto lineNumber = message->GetLineNumber(isolate->GetCurrentContext());
40 if (lineNumber.IsJust()) 40 if (lineNumber.IsJust())
41 error << lineNumber.FromJust(); 41 error << lineNumber.FromJust();
42 else 42 else
43 error << "<unknown>"; 43 error << "<unknown>";
44 } 44 }
45 return error.str(); 45 return error.str();
46 } 46 }
47
48 JsError::JsError(const char* message, const char* filename, int line)
49 : std::runtime_error(ErrorToString(message, filename, line))
50 {
51 }
52
53 std::string JsError::ErrorToString(const char* message, const char* filename, in t line)
54 {
55 std::stringstream error;
56 error << message;
57 error << filename;
58 error << ":";
59 error << line;
60 return error.str();
61 }
OLDNEW
« no previous file with comments | « src/JsError.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld