Revision: 28025
          http://sourceforge.net/p/bibdesk/svn/28025
Author:   hofman
Date:     2022-10-14 14:47:50 +0000 (Fri, 14 Oct 2022)
Log Message:
-----------
don't bother returning error that will be ignored in all cases

Modified Paths:
--------------
    trunk/bibdesk/BDSKWebGroup.m
    trunk/bibdesk/BDSKWebParser.h
    trunk/bibdesk/BDSKWebParser.m
    trunk/bibdesk/de.lproj/Localizable.strings
    trunk/bibdesk/en.lproj/Localizable.strings
    trunk/bibdesk/fr.lproj/Localizable.strings

Modified: trunk/bibdesk/BDSKWebGroup.m
===================================================================
--- trunk/bibdesk/BDSKWebGroup.m        2022-10-14 14:40:06 UTC (rev 28024)
+++ trunk/bibdesk/BDSKWebGroup.m        2022-10-14 14:47:50 UTC (rev 28025)
@@ -248,10 +248,9 @@
 - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
        NSURL *url = [[[frame dataSource] request] URL];
     DOMDocument *domDocument = [frame DOMDocument];
-    NSError *error = nil;
     BOOL shouldMonitorURL = NO;
     
-    BDSKWebParser *parser = [BDSKWebParser parserForDocument:domDocument 
fromURL:url shouldMonitor:&shouldMonitorURL error:&error];
+    BDSKWebParser *parser = [BDSKWebParser parserForDocument:domDocument 
fromURL:url shouldMonitor:&shouldMonitorURL];
     
     if (parser) {
         
@@ -288,19 +287,11 @@
             }
             BDSKStringType type = [string contentStringType];
             if (type == BDSKStringTypeBibTeX)
-                newPubs = [BDSKBibTeXParser itemsFromString:string owner:self 
error:&error];
+                newPubs = [BDSKBibTeXParser itemsFromString:string owner:self 
error:NULL];
             else if (type == BDSKStringTypeNoKeyBibTeX)
-                newPubs = [BDSKBibTeXParser itemsFromString:[string 
stringWithPhoneyCiteKeys:[BibItem defaultCiteKey]] owner:self error:&error];
+                newPubs = [BDSKBibTeXParser itemsFromString:[string 
stringWithPhoneyCiteKeys:[BibItem defaultCiteKey]] owner:self error:NULL];
             else if (type != BDSKStringTypeUnknown)
-                newPubs = [BDSKStringParser itemsFromString:string ofType:type 
error:&error];
-        } else if ([MIMEType hasPrefix:@"text/"]) {
-            // !!! logs are here to help diagnose problems that users are 
reporting
-            // but unsupported web pages are far too common, we don't want to 
flood the console
-            if ([error isLocalErrorWithCode:kBDSKWebParserUnsupported] == NO)
-                NSLog(@"-[%@ %@] %@", [self class], 
NSStringFromSelector(_cmd), error);
-            //NSLog(@"loaded MIME type %@", [[dataSource mainResource] 
MIMEType]);
-            // !!! what to do here? if user clicks on a PDF, we're loading 
application/pdf, which is clearly not an error from the user perspective...so 
should the error only be presented for text/plain?
-            //[NSApp presentError:error];
+                newPubs = [BDSKStringParser itemsFromString:string ofType:type 
error:NULL];
         }
         
         if ([newPubs count])

Modified: trunk/bibdesk/BDSKWebParser.h
===================================================================
--- trunk/bibdesk/BDSKWebParser.h       2022-10-14 14:40:06 UTC (rev 28024)
+++ trunk/bibdesk/BDSKWebParser.h       2022-10-14 14:47:50 UTC (rev 28025)
@@ -58,7 +58,7 @@
 }
 
 // this method is the main entry point for the BDSKWebParser class
-+ (BDSKWebParser *)parserForDocument:(DOMDocument *)domDocument fromURL:(NSURL 
*)url shouldMonitor:(BOOL *)shouldMonitor error:(NSError **)outError;
++ (BDSKWebParser *)parserForDocument:(DOMDocument *)domDocument fromURL:(NSURL 
*)url shouldMonitor:(BOOL *)shouldMonitor;
 
 // Returns all parser classes of a specific feature
 + (NSArray *)parsers;

Modified: trunk/bibdesk/BDSKWebParser.m
===================================================================
--- trunk/bibdesk/BDSKWebParser.m       2022-10-14 14:40:06 UTC (rev 28024)
+++ trunk/bibdesk/BDSKWebParser.m       2022-10-14 14:47:50 UTC (rev 28025)
@@ -127,7 +127,7 @@
 }
 
 // entry point for web group
-+ (BDSKWebParser *)parserForDocument:(DOMDocument *)domDocument fromURL:(NSURL 
*)url shouldMonitor:(BOOL *)shouldMonitor error:(NSError **)outError{
++ (BDSKWebParser *)parserForDocument:(DOMDocument *)domDocument fromURL:(NSURL 
*)url shouldMonitor:(BOOL *)shouldMonitor {
     
     Class parserClass = Nil;
     BOOL shouldMonitorURL = NO;
@@ -141,14 +141,9 @@
     if (shouldMonitor)
         *shouldMonitor = shouldMonitorURL;
     
-    // this may lead to some false negatives if the heuristics for 
canParseDocument::: change.
-    if (Nil == parserClass) {
-        if (outError) {
-            *outError = [NSError 
mutableLocalErrorWithCode:kBDSKWebParserUnsupported 
localizedDescription:NSLocalizedString(@"Unsupported URL", @"error when parsing 
text fails")];
-            [*outError setValue:NSLocalizedString(@"BibDesk was not able to 
find a parser for this web page.", @"error description") 
forKey:NSLocalizedRecoverySuggestionErrorKey];
-        }
+    // this may lead to some false negatives if the heuristics for 
canParseDocument:: change.
+    if (Nil == parserClass)
         return nil;
-    }
     
     BDSKASSERT([parserClass isSubclassOfClass:[BDSKWebParser class]]);
 

Modified: trunk/bibdesk/de.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/en.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/fr.lproj/Localizable.strings
===================================================================
(Binary files differ)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to