0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:49:32 +01:00
posthog/hogql_parser/error.cpp
Michael Matloka 715a8b924e
fix(hogql): Only expose HogQL exceptions relevant to users (#21329)
* fix(hogql): Only expose HogQL exceptions relevant to users

* Update http.py

* Use exposed exceptions more liberally

* Update more handling

* Update action.py

* Rename `Exception` to `Error`

* Use new hogql-parser version

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-05 11:39:20 +00:00

18 lines
815 B
C++

#include "error.h"
using namespace std;
#define ERROR_CLASS_IMPLEMENTATION(NAME, BASE) \
NAME::NAME(const string& message, size_t start, size_t end) : BASE(message), start(start), end(end) {} \
NAME::NAME(const char* message, size_t start, size_t end) : BASE(message), start(start), end(end) {} \
NAME::NAME(const string& message) : BASE(message), start(0), end(0) {} \
NAME::NAME(const char* message) : BASE(message), start(0), end(0) {}
ERROR_CLASS_IMPLEMENTATION(HogQLError, runtime_error)
ERROR_CLASS_IMPLEMENTATION(SyntaxError, HogQLError)
ERROR_CLASS_IMPLEMENTATION(NotImplementedError, HogQLError)
ERROR_CLASS_IMPLEMENTATION(ParsingError, HogQLError)
PyInternalError::PyInternalError() : exception() {}