Last modified: 2011-06-05 19:39:57 UTC
Error: Exception Caught: Internal error in ApiFormatRaw::getMimeType: No MIME type set for raw formatter Page: http://en.wikipedia.org/w/api.php?action=query&title=Main%20page&export&exportnowrap I was messing around with the API, when I got this error. The the fact that the query is non-functional is almost certainly the result of me throwing it a nonsensical combination of inputs, but even so, the API should probably fail more gracefully. Regards.
Personally, I'm not sure it's something that is needed to fail more gracefully, or at least, not where the error is coming from if ( !isset( $data['mime'] ) ) { ApiBase::dieDebug( __METHOD__, 'No MIME type set for raw formatter' ); } That looks sane. If the set of options you are providing are indeed rubbish (ie no output should be given for them), then that does want looking at and potentially protecting against.
http://en.wikipedia.org/w/api.php?action=query&titles=Main%20page&export&exportnowrap title --> titles make it play nicely Looks like ApiQuery isn't checking for existence of at least 1 of the following titles/pageids/revids
Bleh, ApiPageSet // Only one of the titles/pageids/revids is allowed at the same time $dataSource = null; if ( isset( $params['titles'] ) ) { $dataSource = 'titles'; } if ( isset( $params['pageids'] ) ) { if ( isset( $dataSource ) ) { $this->dieUsage( "Cannot use 'pageids' at the same time as '$dataSource'", 'multisource' ); } $dataSource = 'pageids'; } if ( isset( $params['revids'] ) ) { if ( isset( $dataSource ) ) { $this->dieUsage( "Cannot use 'revids' at the same time as '$dataSource'", 'multisource' ); } $dataSource = 'revids'; } And then switch ( $dataSource ) { //snip default: // Do nothing - some queries do not need any of the data sources. break; } So we need a way to track for the export if we haven't specified a title when we needed to... Though, it does do // only export when there are titles if ( !count( $exportTitles ) ) { return; } It probably should just fail/do more like what http://en.wikipedia.org/w/api.php?action=query&title=Main%20page&export does, giving "<api />"
http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrsearch=Micheal%20jorda&prop=info&export&exportnowrap&gsrlimit=100&gsrwhat=text&gsroffset=50 also gives it
r89523