File tree Expand file tree Collapse file tree 4 files changed +33
-9
lines changed
src/main/java/com/microsoft/graph/http Expand file tree Collapse file tree 4 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -86,4 +86,15 @@ protected String transformErrorCodeCase(@Nonnull final String original) {
8686 Objects .requireNonNull (original , "parameter original cannot be null" );
8787 return CaseFormat .LOWER_CAMEL .to (CaseFormat .UPPER_UNDERSCORE , original );
8888 }
89+
90+ //TODO comments
91+ public static final GraphError graphErrorCopy (GraphError error ) {
92+ GraphError errorCopy = new GraphError ();
93+ errorCopy .message = error .message ;
94+ errorCopy .code = error .code ;
95+ if (error .innererror !=null ) {
96+ errorCopy .innererror = GraphInnerError .graphInnerErrorCopy (error .innererror );
97+ }
98+ return errorCopy ;
99+ }
89100}
Original file line number Diff line number Diff line change @@ -72,14 +72,13 @@ public final AdditionalDataManager additionalDataManager() {
7272 return additionalDataManager ;
7373 }
7474
75- public GraphErrorResponse getCopy ()
75+ //TODO: Comments
76+ public static GraphErrorResponse getErrorCopy (GraphErrorResponse response )
7677 {
77- //makeCopy of error
78- //make copy of additionalData manager
79- //make copy of raw object
80- return this ;
81-
78+ GraphErrorResponse copy = new GraphErrorResponse ();
79+ copy . additionalDataManager = response . additionalDataManager (); //We are okay with keeping the dataManager intact
80+ copy . rawObject = response . rawObject . deepCopy ();
81+ copy . error = GraphError . graphErrorCopy ( response . error ) ;
82+ return copy ;
8283 }
83-
84-
8584}
Original file line number Diff line number Diff line change @@ -60,4 +60,18 @@ public class GraphInnerError {
6060 @ SerializedName ("innererror" )
6161 @ Nullable
6262 public GraphInnerError innererror ;
63+
64+ //TODO: Comments
65+ public static final GraphInnerError graphInnerErrorCopy (GraphInnerError InnerError ) {
66+ GraphInnerError innerErrorCopy = new GraphInnerError ();
67+ innerErrorCopy .code = InnerError .code ;
68+ innerErrorCopy .errorType = InnerError .errorType ;
69+ innerErrorCopy .debugMessage = InnerError .debugMessage ;
70+ innerErrorCopy .stackTrace = InnerError .stackTrace ;
71+ innerErrorCopy .throwSite = InnerError .throwSite ;
72+ if (InnerError .innererror != null ) {
73+ innerErrorCopy .innererror = graphInnerErrorCopy (InnerError .innererror );
74+ }
75+ return innerErrorCopy ;
76+ }
6377}
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ public List<String> getResponseHeaders() {
212212 */
213213 @ Nullable
214214 public GraphErrorResponse getError () {
215- return error . getCopy (); //Copy the error, deserialize and copy contents TODO
215+ return GraphErrorResponse . getErrorCopy ( error );
216216 }
217217
218218 /**
You can’t perform that action at this time.
0 commit comments