Skip to content

Commit 9f6075b

Browse files
committed
Improve exception for unexpected error
1 parent 51155c4 commit 9f6075b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

java/org/apache/catalina/mapper/LocalStrings.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ mapper.addHost.sameHost=Duplicate registration of the same host [{0}]. Ignored.
1919
mapper.addHost.success=Registered host [{0}]
2020
mapper.addHostAlias.sameHost=Duplicate registration of alias [{0}] for the same host [{1}]. Ignored.
2121
mapper.addHostAlias.success=Registered alias [{0}] for host [{1}]
22+
mapper.alreadyDone=Mapping was already done on this request on host [{0}]
2223
mapper.duplicateHost=Duplicate Host [{0}]. The name is already used by Host [{1}]. This Host will be ignored.
2324
mapper.duplicateHostAlias=Duplicate host Alias [{0}] in Host [{1}]. The name is already used by Host [{2}]. This Alias will be ignored.
2425
mapper.findContext.noContext=No context found [{0}]

java/org/apache/catalina/mapper/Mapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ private void internalMap(CharChunk host, CharChunk uri, String version, MappingD
710710
// skipped all mapping work in this case. That behaviour has a risk
711711
// of returning an inconsistent result.
712712
// I do not see a valid use case for it.
713-
throw new AssertionError();
713+
throw new IllegalStateException(sm.getString("mapper.alreadyDone", mappingData.host));
714714
}
715715

716716
// Virtual host mapping

0 commit comments

Comments
 (0)