nucypher/taco-web

Remove console.error and implement proper error logging in signing module

開放

#694 建立於 2025年8月20日

 (3 則留言) (0 個反應) (0 位負責人)TypeScript (25 個分叉)auto 404
enhancementgood first issue

倉庫指標

星標
 (35 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Overview

The signing module currently uses console.error for error logging, which is not ideal for production code. This should be replaced with a proper error handling mechanism that doesn't output to console in production environments.

Current Behavior

In packages/taco/src/sign.ts:157-160, there's a console.error statement:

console.error(
  'Porter returned mismatched message hashes:',
  hashToSignatures,
);

Expected Behavior

  • Remove the console.error statement
  • The error information should be included in the thrown error or handled through a proper logging mechanism
  • Consider including the mismatched hashes information in the error message itself

Files to Change

  • packages/taco/src/sign.ts (line 157-160)

Implementation Suggestions

  1. Include the debug information in the error message that's thrown
  2. Consider creating a debug mode flag that conditionally logs verbose information
  3. Ensure sensitive information isn't exposed in error messages

Definition of Done

  • console.error removed from the code
  • Error information is still accessible for debugging
  • Tests still pass
  • No console output in production builds

貢獻者指南