Skip to content

Commit aa262eb

Browse files
authored
Merge pull request #4587 from noraz31/product_err_to_warning
[fix] Demote product not found errors to debug in the CC logs
2 parents 3f08522 + 3c58010 commit aa262eb

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

web/server/codechecker_server/server.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
LOG = get_logger('server')
7171

7272

73+
class ProductNotFoundError(ValueError):
74+
pass
75+
76+
7377
class RequestHandler(SimpleHTTPRequestHandler):
7478
"""
7579
Handle thrift and browser requests
@@ -319,7 +323,7 @@ def __check_prod_db(self, product_endpoint):
319323

320324
product = self.server.get_product(product_endpoint)
321325
if not product:
322-
raise ValueError(
326+
raise ProductNotFoundError(
323327
f"The product with the given endpoint '{product_endpoint}' "
324328
"does not exist!")
325329

@@ -510,9 +514,12 @@ def do_POST(self):
510514
import traceback
511515
traceback.print_exc()
512516
except Exception as ex:
513-
LOG.warning("%s failed with Exception: %s", api_info, str(ex))
514-
import traceback
515-
traceback.print_exc()
517+
if isinstance(ex, ProductNotFoundError):
518+
LOG.debug("%s failed with Exception: %s", api_info, str(ex))
519+
else:
520+
LOG.warning("%s failed with Exception: %s", api_info, str(ex))
521+
import traceback
522+
traceback.print_exc()
516523

517524
cstringio_buf = itrans.cstringio_buf.getvalue()
518525
if cstringio_buf:

0 commit comments

Comments
 (0)