How to use the italia-ts-commons/lib/reporters.ReadableReporter.report function in italia-ts-commons

To help you get started, we’ve selected a few italia-ts-commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teamdigitale / io-functions / lib / utils / azure_queues.ts View on Github external
export function updateMessageVisibilityTimeout(
  queueService: QueueService,
  queueName: string,
  queueMessageBindings: Context["bindings"]
): Promise {
  const queueMessageValidation = QueueMessage.decode(queueMessageBindings);
  if (queueMessageValidation.isLeft()) {
    winston.error(
      `Unable to decode queue message from bindings: ${ReadableReporter.report(
        queueMessageValidation
      )}`
    );
    return Promise.reject(new Error("INVALID_QUEUE_MESSAGE_IN_BINDINGS"));
  }
  const queueMessage = queueMessageValidation.value;
  return new Promise(resolve => {
    winston.debug(
      `updateMessageVisibilityTimeout|Retry to handle message ${queueName}:${queueMessageToString(
        queueMessage
      )}`
    );

    // dequeueCount starts with one (not zero)
    const numberOfRetries = queueMessage.dequeueCount;