When serialized, we convert the error detail to a GenericErrorDetail with string sources. This hurts our formatting, but it guarantees that the receiving end will be able to read the message.
()
| 167 | * read the message. |
| 168 | */ |
| 169 | private Object writeReplace() throws ObjectStreamException { |
| 170 | Object[] sourcesAsStrings = getSources().toArray(); |
| 171 | for (int i = 0; i < sourcesAsStrings.length; i++) { |
| 172 | sourcesAsStrings[i] = Errors.convert(sourcesAsStrings[i]).toString(); |
| 173 | } |
| 174 | return new Message( |
| 175 | errorId, |
| 176 | new GenericErrorDetail( |
| 177 | errorId, getMessage(), ImmutableList.copyOf(sourcesAsStrings), getCause())); |
| 178 | } |
| 179 | |
| 180 | private static final long serialVersionUID = 0; |
| 181 | } |
nothing calls this directly
no test coverage detected