Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Fix cache to throw user limit exceeded emails

Acho Arnold5206f42b84c5
diff --git a/api/pkg/cache/memory_cache.go b/api/pkg/cache/memory_cache.go
index 1cfc5b4b..2e32bcff 100644
--- a/api/pkg/cache/memory_cache.go
+++ b/api/pkg/cache/memory_cache.go
@@ -31,7 +31,7 @@ func (cache *memoryCache) Get(ctx context.Context, key string) (value string, er
response, ok := cache.store.Get(key)
if !ok {
- return "", stacktrace.Propagate(err, fmt.Sprintf("no item found in cache with key [%s]", key))
+ return "", stacktrace.NewError(fmt.Sprintf("no item found in cache with key [%s]", key))
}
return response.(string), nil
diff --git a/api/pkg/handlers/message_handler.go b/api/pkg/handlers/message_handler.go
index bafa7a47..7663670d 100644
--- a/api/pkg/handlers/message_handler.go
+++ b/api/pkg/handlers/message_handler.go
@@ -356,7 +356,7 @@ func (h *MessageHandler) PostReceive(c *fiber.Ctx) error {
}
if msg := h.billingService.IsEntitled(ctx, h.userIDFomContext(c)); msg != nil {
- ctxLogger.Warn(stacktrace.NewError(fmt.Sprintf("user with ID [%s] can't receive a message", h.userIDFomContext(c))))
+ ctxLogger.Warn(stacktrace.NewError(fmt.Sprintf("user with ID [%s] can't receive a message becasuse they have exceeded the limit", h.userIDFomContext(c))))
return h.responsePaymentRequired(c, *msg)
}