summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthallgren2011-09-27 11:33:31 (EDT)
committerKevin Sawicki2011-09-27 11:33:31 (EDT)
commit706fa65b8ee1f2d1b14863af21ced8dd9fe9f582 (patch)
tree82af3101fcf8fb7995869b7ccbdb9d736fb2cc28
parent11f7b6dcb89046c953b8e3167045e3d05e259aa9 (diff)
downloadegit-github-706fa65b8ee1f2d1b14863af21ced8dd9fe9f582.zip
egit-github-706fa65b8ee1f2d1b14863af21ced8dd9fe9f582.tar.gz
egit-github-706fa65b8ee1f2d1b14863af21ced8dd9fe9f582.tar.bz2
Add message field to the FieldError model class.refs/changes/92/4292/2
Certain errors reported from GitHub have a 'message' field. This field is missing in the FieldError class which means that the information is lost. Bug: 358924 Change-Id: I6d00fae2fb839e0900629eeda46f6f7600d1fd59 Signed-off-by: Thomas Hallgren <thomas@tada.se> Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/FieldErrorTest.java2
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/FieldError.java17
2 files changed, 19 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/FieldErrorTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/FieldErrorTest.java
index e2c7595..4458c52 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/FieldErrorTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/FieldErrorTest.java
@@ -29,6 +29,7 @@ public class FieldErrorTest {
FieldError error = new FieldError();
assertNull(error.getCode());
assertNull(error.getField());
+ assertNull(error.getMessage());
assertNull(error.getResource());
assertNull(error.getValue());
}
@@ -42,6 +43,7 @@ public class FieldErrorTest {
assertEquals("invalid", error.setCode("invalid").getCode());
assertEquals("name", error.setField("name").getField());
assertEquals("commit", error.setResource("commit").getResource());
+ assertEquals("message", error.setMessage("message").getMessage());
assertEquals("-1", error.setValue("-1").getValue());
}
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/FieldError.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/FieldError.java
index f474769..fd1bd1e 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/FieldError.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/FieldError.java
@@ -44,6 +44,8 @@ public class FieldError implements Serializable {
private String field;
+ private String message;
+
private String resource;
private String value;
@@ -81,6 +83,21 @@ public class FieldError implements Serializable {
}
/**
+ * @return message
+ */
+ public String getMessage() {
+ return message;
+ }
+ /**
+ * @param message
+ * @return this field error
+ */
+ public FieldError setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
* @return resource
*/
public String getResource() {