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

Added toString methods to api.Error and api.Error.Location #2905

Merged
merged 2 commits into from Jan 28, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions apollo-api/api.txt
Expand Up @@ -145,6 +145,7 @@ package com.apollographql.apollo.api {
method public int hashCode();
method @Deprecated public java.util.List<com.apollographql.apollo.api.Error.Location> locations();
method @Deprecated public String? message();
method public String toString();
}

public static final class Error.Location {
Expand All @@ -155,6 +156,7 @@ package com.apollographql.apollo.api {
method public long getLine();
method public int hashCode();
method @Deprecated public long line();
method public String toString();
}

@com.apollographql.apollo.api.ApolloExperimental public interface ExecutionContext {
Expand Down
Expand Up @@ -61,6 +61,10 @@ class Error(
return result
}

override fun toString(): String {
return "Error(message = $message, locations = $locations, customAttributes = $customAttributes)"
}

/**
* Represents the location of the error in the GraphQL operation sent to the server. This location is represented in
* terms of the line and column number.
Expand Down Expand Up @@ -106,5 +110,9 @@ class Error(
result = 31 * result + column.hashCode()
return result
}

override fun toString(): String {
return "Location(line = $line, column = $column)"
}
}
}