catch http errors
This commit is contained in:
		@@ -5,8 +5,7 @@ import pickle
 | 
				
			|||||||
from abc import ABC, abstractmethod
 | 
					from abc import ABC, abstractmethod
 | 
				
			||||||
from datetime import datetime, timedelta
 | 
					from datetime import datetime, timedelta
 | 
				
			||||||
from urllib import request
 | 
					from urllib import request
 | 
				
			||||||
 | 
					from urllib.error import HTTPError
 | 
				
			||||||
from pycsdr.types import Format
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
from csdr.module import PickleModule
 | 
					from csdr.module import PickleModule
 | 
				
			||||||
from owrx.aprs import AprsParser, AprsLocation
 | 
					from owrx.aprs import AprsParser, AprsLocation
 | 
				
			||||||
@@ -88,6 +87,8 @@ class RadioIDEnricher(Enricher):
 | 
				
			|||||||
                        return item
 | 
					                        return item
 | 
				
			||||||
        except json.JSONDecodeError:
 | 
					        except json.JSONDecodeError:
 | 
				
			||||||
            logger.warning("unable to parse radioid response JSON")
 | 
					            logger.warning("unable to parse radioid response JSON")
 | 
				
			||||||
 | 
					        except HTTPError as e:
 | 
				
			||||||
 | 
					            logger.warning("radioid responded with error: %s", str(e))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user