Explorar el Código

80783 fix codes where it throws exception just to do logger.error

Yohei-Shiina hace 4 años
padre
commit
1f55126fe2
Se han modificado 1 ficheros con 4 adiciones y 14 borrados
  1. 4 14
      packages/app/src/components/SearchPage/SearchResultListItem.tsx

+ 4 - 14
packages/app/src/components/SearchPage/SearchResultListItem.tsx

@@ -88,13 +88,8 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
         className="d-block pt-3"
         href={pageId}
         onClick={() => {
-          try {
-            if (onClickInvoked == null) { throw new Error('onClickInvoked is null') }
-            onClickInvoked(page._id);
-          }
-          catch (error) {
-            logger.error(error);
-          }
+          if (onClickInvoked == null) { logger.error('onClickInvoked is null') }
+          else { onClickInvoked(page._id) }
         }}
       >
         <div className="d-flex">
@@ -105,13 +100,8 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
               type="checkbox"
               id="flexCheckDefault"
               onClick={() => {
-                try {
-                  if (onChangedInvoked == null) { throw new Error('onChangedInvoked is null') }
-                  onChangedInvoked(page);
-                }
-                catch (error) {
-                  logger.error(error);
-                }
+                if (onChangedInvoked == null) { logger.error('onChangedInvoked is null') }
+                else { onChangedInvoked(page) }
               }}
             />
           </div>