|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 package org.mozilla.gecko.background.sync.helpers; |
|
5 |
|
6 import org.mozilla.gecko.sync.repositories.InvalidRequestException; |
|
7 import org.mozilla.gecko.sync.repositories.domain.Record; |
|
8 |
|
9 public class ExpectInvalidRequestFetchDelegate extends DefaultFetchDelegate { |
|
10 public static final String LOG_TAG = "ExpInvRequestFetchDel"; |
|
11 |
|
12 @Override |
|
13 public void onFetchFailed(Exception ex, Record rec) { |
|
14 if (ex instanceof InvalidRequestException) { |
|
15 onDone(); |
|
16 } else { |
|
17 performNotify("Expected InvalidRequestException but got ", ex); |
|
18 } |
|
19 } |
|
20 |
|
21 private void onDone() { |
|
22 performNotify(); |
|
23 } |
|
24 } |