Skip to content

Commit 54a9e73

Browse files
committed
Exposed getErrorCode as getErrorCodeNew
1 parent dd0ba1e commit 54a9e73

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/com/google/firebase/FirebaseException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public FirebaseException(
5757
*
5858
* @return A Firebase error code.
5959
*/
60-
// TODO: Expose this method publicly
61-
ErrorCode getErrorCode() {
60+
// TODO: Rename this method to getErrorCode when the child classes are refactored.
61+
public ErrorCode getErrorCodeNew() {
6262
return errorCode;
6363
}
6464

src/test/java/com/google/firebase/FirebaseExceptionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void testFirebaseExceptionWithoutResponseAndCause() {
6767
null,
6868
null);
6969

70-
assertEquals(ErrorCode.INTERNAL, exception.getErrorCode());
70+
assertEquals(ErrorCode.INTERNAL, exception.getErrorCodeNew());
7171
assertEquals("Test error", exception.getMessage());
7272
assertNull(exception.getHttpResponse());
7373
assertNull(exception.getCause());
@@ -86,7 +86,7 @@ public void testFirebaseExceptionWithResponse() throws IOException {
8686
response,
8787
null);
8888

89-
assertEquals(ErrorCode.INTERNAL, exception.getErrorCode());
89+
assertEquals(ErrorCode.INTERNAL, exception.getErrorCodeNew());
9090
assertEquals("Test error", exception.getMessage());
9191
assertSame(response, exception.getHttpResponse());
9292
assertNull(exception.getCause());
@@ -102,7 +102,7 @@ public void testFirebaseExceptionWithCause() {
102102
null,
103103
cause);
104104

105-
assertEquals(ErrorCode.INTERNAL, exception.getErrorCode());
105+
assertEquals(ErrorCode.INTERNAL, exception.getErrorCodeNew());
106106
assertEquals("Test error", exception.getMessage());
107107
assertNull(exception.getHttpResponse());
108108
assertSame(cause, exception.getCause());
@@ -112,7 +112,7 @@ public void testFirebaseExceptionWithCause() {
112112
public void testFirebaseExceptionLegacyConstructor() {
113113
FirebaseException exception = new FirebaseException("Test error");
114114

115-
assertEquals(ErrorCode.UNKNOWN, exception.getErrorCode());
115+
assertEquals(ErrorCode.UNKNOWN, exception.getErrorCodeNew());
116116
assertEquals("Test error", exception.getMessage());
117117
assertNull(exception.getHttpResponse());
118118
assertNull(exception.getCause());

0 commit comments

Comments
 (0)