projects
/
facebook-errors
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f2b31d
)
GraphApiException.create() logs unmapped errors on log-level INFO
author
Kai Moritz
<kai@juplo.de>
Sat, 7 Nov 2015 14:40:05 +0000
(15:40 +0100)
committer
Kai Moritz
<kai@juplo.de>
Tue, 10 Nov 2015 14:51:19 +0000
(15:51 +0100)
src/main/java/de/juplo/facebook/exceptions/GraphApiException.java
patch
|
blob
|
history
diff --git
a/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java
b/src/main/java/de/juplo/facebook/exceptions/GraphApiException.java
index
bd02565
..
ee62a93
100644
(file)
--- a/
src/main/java/de/juplo/facebook/exceptions/GraphApiException.java
+++ b/
src/main/java/de/juplo/facebook/exceptions/GraphApiException.java
@@
-11,6
+11,8
@@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.IOException;
import java.io.InputStream;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.IOException;
import java.io.InputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
/**
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
/**
@@
-20,6
+22,7
@@
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
*/
public class GraphApiException extends OAuth2Exception
{
*/
public class GraphApiException extends OAuth2Exception
{
+ final static Logger LOG = LoggerFactory.getLogger(GraphApiException.class);
final static ObjectMapper OBJECT_MAPPER;
private final FacebookErrorMessage error;
final static ObjectMapper OBJECT_MAPPER;
private final FacebookErrorMessage error;
@@
-77,7
+80,9
@@
public class GraphApiException extends OAuth2Exception
// 1000..1099: event api errors
// 1100..1199: live-message errors
// 1000..1099: event api errors
// 1100..1199: live-message errors
- default: return new UnmappedErrorException(error);
+ default:
+ LOG.info("unmapped error: {}", error);
+ return new UnmappedErrorException(error);
}
}
}
}
@@
-129,7
+134,9
@@
public class GraphApiException extends OAuth2Exception
}
catch(JsonProcessingException e)
{
}
catch(JsonProcessingException e)
{
- return "Could not convert error in JSON-representation: " + e.getMessage();
+ // This should never happen. But in case of a mistake: be verbose!
+ LOG.error("could not convert message into JSON: {}", e);
+ return e.getMessage();
}
}
}
}