Skip to content
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

Remove variable names from error messages. #885

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions gapis/api/gles/gles.api
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,28 @@ sub void supportsBits(GLbitfield seenBits, GLbitfield validBits) {
if (seenBits & validBits) != seenBits { glErrorInvalidValue() }
}

sub void glErrorInvalidEnum(GLenum param) {
sub void glErrorInvalidEnum(GLenum value) {
glErrorInvalidEnumMsg(new!ERR_INVALID_ENUM(value: as!u32(value)))
}

sub void glErrorInvalidEnumMsg(message m) {
onGlError(GL_INVALID_ENUM)
// TODO: be more specific in callers
_ = newMsg(SEVERITY_ERROR, new!ERR_INVALID_ENUM_VALUE(value: 0,variable: "variable"))
_ = newMsg(SEVERITY_ERROR, m)
abort
}

sub void glErrorInvalidValue() {
glErrorInvalidValueMsg(new!ERR_INVALID_VALUE())
}

sub void glErrorInvalidValueMsg(message m) {
onGlError(GL_INVALID_VALUE)
_ = newMsg(SEVERITY_ERROR, new!ERR_INVALID_VALUE(value: "value",variable: "variable"))
_ = newMsg(SEVERITY_ERROR, m)
abort
}

sub void glErrorInvalidOperation() {
glErrorInvalidOperationMsg(new!ERR_INVALID_OPERATION(operation: "operation"))
glErrorInvalidOperationMsg(new!ERR_INVALID_OPERATION())
}

sub void glErrorInvalidOperationMsg(message m) {
Expand All @@ -76,12 +83,6 @@ sub void glErrorInvalidOperationMsg(message m) {
abort
}

sub void glErrorInvalidValueMsg(message m) {
onGlError(GL_INVALID_VALUE)
_ = newMsg(SEVERITY_ERROR, m)
abort
}

sub T max!T(T a, T b) {
return switch a > b {
case true: a
Expand Down
8 changes: 4 additions & 4 deletions gapis/messages/en-us.stb.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ The slice {{from_value}}:{{to_value}} for {{from_variable}}:{{to_variable}} is o

# ERR_INVALID_VALUE

Invalid value {{value}} for {{variable}}.
Invalid value.

# ERR_INVALID_ENUM_VALUE
# ERR_INVALID_ENUM

Invalid enum value {{value:u32}} for {{variable:string}}.
Invalid enum {{value:u32}}.

# ERR_INVALID_OPERATION

Invalid operation: {{operation}}.
Invalid operation.

# ERR_CONTEXT_DOES_NOT_EXIST

Expand Down
2 changes: 1 addition & 1 deletion gapis/resolve/framebuffer_attachment_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (r *FramebufferAttachmentBytesResolvable) Resolve(ctx context.Context) (int
case service.WireframeMode_Overlay:
wireframeMode = replay.WireframeMode_Overlay
default:
return nil, &service.ErrInvalidArgument{Reason: messages.ErrInvalidEnumValue(wireframeMode, "WireframeMode")}
return nil, &service.ErrInvalidArgument{Reason: messages.ErrInvalidEnum(wireframeMode)}
}

mgr := replay.GetManager(ctx)
Expand Down