You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by afs <gi...@git.apache.org> on 2017/08/20 14:40:11 UTC
[GitHub] jena pull request #275: JENA-1383: Improve handling of bad character encodin...
GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/275
JENA-1383: Improve handling of bad character encoding.
https://issues.apache.org/jira/browse/JENA-1383
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena bad-encoding
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/275.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #275
----
commit 9f545d3a17cdc105e3b78726412b163385d9ccce
Author: Andy Seaborne <an...@apache.org>
Date: 2017-08-20T14:34:27Z
Improve handling of bad character encoding.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] jena pull request #275: JENA-1383: Improve handling of bad character encodin...
Posted by ajs6f <gi...@git.apache.org>.
Github user ajs6f commented on a diff in the pull request:
https://github.com/apache/jena/pull/275#discussion_r134117416
--- Diff: jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java ---
@@ -205,7 +206,11 @@ public static void parse(HttpAction action, StreamRDF dest, InputStream input, L
.lang(lang)
.base(base)
.parse(dest);
- }
+ } catch (RuntimeIOException ex) {
+ if ( ex.getCause() instanceof CharacterCodingException )
+ throw new RiotException("Character Coding Error: "+ex.getMessage());
--- End diff --
maybe `throw new RiotException("Character Coding Error: "+ex.getMessage(), ex.getCause());` to keep more context?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] jena pull request #275: JENA-1383: Improve handling of bad character encodin...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/jena/pull/275
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] jena pull request #275: JENA-1383: Improve handling of bad character encodin...
Posted by afs <gi...@git.apache.org>.
Github user afs commented on a diff in the pull request:
https://github.com/apache/jena/pull/275#discussion_r134117642
--- Diff: jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionSPARQL.java ---
@@ -205,7 +206,11 @@ public static void parse(HttpAction action, StreamRDF dest, InputStream input, L
.lang(lang)
.base(base)
.parse(dest);
- }
+ } catch (RuntimeIOException ex) {
+ if ( ex.getCause() instanceof CharacterCodingException )
+ throw new RiotException("Character Coding Error: "+ex.getMessage());
--- End diff --
This is an error caught and handled as an HTTP servlet response and is a bad request - the client's mistake. It is not an error in the server to track down so I see this as normal processing from the server's point of view. The message is the information needed for the HTTP response.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---