X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2common%2Fviews%2Fpagination_route.py;h=a6c54959334de00ff2a4036824c294314035830d;hb=e491f4c2a7a762eba966c77ae14b9ad6859220cc;hp=c595d9f96c31b578f7f895f875e07f3c48ab1bad;hpb=8f7352951c11d939bae11422c00c87dc1f1d2a85;p=pti%2Fo2.git diff --git a/o2common/views/pagination_route.py b/o2common/views/pagination_route.py index c595d9f..a6c5495 100644 --- a/o2common/views/pagination_route.py +++ b/o2common/views/pagination_route.py @@ -13,7 +13,8 @@ # limitations under the License. from urllib.parse import urlparse -from flask import abort + +from o2common.views.route_exception import BadRequestException from o2common.helper import o2logging logger = o2logging.get_logger(__name__) @@ -28,7 +29,8 @@ def link_header(full_path: str, ret): page_current = ret.pop('page_current') if page_current > page_total: - abort(400, "Page size {} bad request.".format(page_current)) + raise BadRequestException( + "Page size {} bad request.".format(page_current)) if 0 == count: return [], {'X-Total-Count': count}