Closed (fixed)
Project:
SPARQL
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2010 at 09:18 UTC
Updated:
3 Aug 2011 at 15:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI agree, I was just thinking this yesterday as I was working on SPARQL Views.
It might be good not just to log the error but also alert the site visitor with a message to the screen... anyone else have an opinion on that?
Comment #2
JeremyFrench commentedI wasn't sure about an error on the screen. I did initially, but as this is an API thing, it may be worth letting the calling function do that or optionally handle the fact there are no results gracefully.
The sparql module had an $errors parameter passed by reference which reported errors back to the calling function, are there any votes to do that here?
Comment #3
milesw commentedComment #4
scor commentedIf
trigger_error('insert ARC2 error here', E_USER_ERROR);is used, errors will be reported to the screen depending on what the site "logging and error" settings is at admin/config/development/logging.Comment #5
Anonymous (not verified) commentedOk, this sounds like a pretty easy fix. I'll give it a shot tonight.
Comment #6
Anonymous (not verified) commentedThis was a simple patch.
Would someone mind testing this? For an easy test, you can do something like the following:
As soon as it is RTBC I'll commit.
Comment #7
Anonymous (not verified) commentedWhoops, forgot needs review
Comment #8
stuartraetaylor commentedLooks good. I've applied the patch and Drupal now displays errors from ARC as expected.
Comment #9
Anonymous (not verified) commentedThanks for reviewing!
Fixed with commit http://drupalcode.org/project/sparql.git/commit/4b8d6e0
Comment #10
scor commentedwhy not returning the results even if there are errors?
Comment #11
Anonymous (not verified) commentedOnly because they weren't returned in the original code... but I don't see a problem with changing that if you think we should.
Comment #12
JeremyFrench commentedRationale behind returning null is that if there has been an error in the sparql request there will either be no results or they will be invalid.
Things have moved on a lot since then so I'm not sure if that is still true.