Skip to content

Commit

Permalink
When an invalid source map state is encountered, throw a SourceMapPar…
Browse files Browse the repository at this point in the history
…seException instead of IllegalStateException so that existing error handling properly recognizes this case.

Closes #2631

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166873243
  • Loading branch information
ChadKillingsworth authored and blickly committed Aug 29, 2017
1 parent f648367 commit 8777c08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/google/debugging/sourcemap/SourceMapConsumerV3.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private class MappingBuilder {
this.content = new StringCharIterator(lineMap);
}

void build() {
void build() throws SourceMapParseException {
int [] temp = new int[MAX_ENTRY_VALUES];
ArrayList<Entry> entries = new ArrayList<>();
while (content.hasNext()) {
Expand Down Expand Up @@ -309,7 +309,7 @@ private void validateEntry(Entry entry) {
* @param entryValues The number of entries in the array.
* @return The entry object.
*/
private Entry decodeEntry(int[] vals, int entryValues) {
private Entry decodeEntry(int[] vals, int entryValues) throws SourceMapParseException {
Entry entry;
switch (entryValues) {
// The first values, if present are in the following order:
Expand Down Expand Up @@ -363,7 +363,7 @@ private Entry decodeEntry(int[] vals, int entryValues) {
return entry;

default:
throw new IllegalStateException(
throw new SourceMapParseException(
"Unexpected number of values for entry:" + entryValues);
}
}
Expand Down

0 comments on commit 8777c08

Please sign in to comment.