Skip to content

Commit

Permalink
when there are no HUs to issue, throw AdempiereException instead of E…
Browse files Browse the repository at this point in the history
…ntityNotFoundException

#329
  • Loading branch information
teosarca committed Apr 27, 2017
1 parent 722d785 commit 5e99fb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/de/metas/ui/web/pporder/PPOrderLinesView.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Set;
import java.util.stream.Stream;

import org.adempiere.exceptions.AdempiereException;
import org.adempiere.util.GuavaCollectors;
import org.adempiere.util.Services;
import org.adempiere.util.collections.ListUtils;
Expand Down Expand Up @@ -286,7 +287,8 @@ public OpenIncludedViewAction actionOpenViewForHUsToIssue(final Set<DocumentId>
final List<Integer> huIdsToAvailableToIssue = Services.get(IHUPPOrderBL.class).retrieveHUsAvailableToIssue(selectedRow.getM_Product_ID());
if (huIdsToAvailableToIssue.isEmpty())
{
throw new EntityNotFoundException("No HUs to issue found");
// NOTE: don't throw EntityNotFoundException because that one would be ignored by frontend.
throw new AdempiereException("No HUs to issue found");
}

final IDocumentViewsRepository viewsRepo = Adempiere.getSpringApplicationContext().getBean(IDocumentViewsRepository.class); // TODO dirty workaround
Expand Down

0 comments on commit 5e99fb7

Please sign in to comment.