-
Notifications
You must be signed in to change notification settings - Fork 699
Create GlowErr type with informational error code enum #2283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
include/glow/Support/Error.h
Outdated
} | ||
} | ||
|
||
GlowErr(llvm::StringRef fileName, int32_t lineNumber, llvm::StringRef message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lineNumber
is int32_t
, while lineNumber_
is size_t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dang, thanks!
lib/Support/Error.cpp
Outdated
return llvm::formatv("Error at file {0} line {1} \"{2}\"", file, line, str); | ||
} | ||
|
||
char GlowErr::ID = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining what this is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
include/glow/Support/Error.h
Outdated
class GlowErr final : public llvm::ErrorInfo<GlowErr> { | ||
public: | ||
/// Used by ErrorInfo::classID. | ||
static char ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make that uint8_t.
include/glow/Support/Error.h
Outdated
static char ID; | ||
/// An enumeration of error codes representing various possible errors that | ||
/// could occur. | ||
enum EC { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be enum class and also no need to explicit values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ErrorCode would be more descriptive.
c37cd08
to
312b6ca
Compare
312b6ca
to
7a58a1c
Compare
Description:
Create an llvm::Error that holds a string and/or an enum that classifies the error so that this information can be used to send correct ONNXIFI statuses.
In followups, handle error codes to send ONNXIFI statuses. Use error codes in the rest of model loading stack.
Testing:
ninja all
Documentation:
doxygen