completed SMS gateway project

This commit is contained in:
Min Zeya Phyo
2025-10-22 17:22:17 +08:00
commit c883fa7128
190 changed files with 16294 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
class ApplicationController < ActionController::API
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
rescue_from ActiveRecord::RecordInvalid, with: :render_unprocessable
rescue_from ActionController::ParameterMissing, with: :render_bad_request
private
def render_not_found(exception)
render json: { error: exception.message }, status: :not_found
end
def render_unprocessable(exception)
render json: {
error: exception.message,
details: exception.record.errors.full_messages
}, status: :unprocessable_entity
end
def render_bad_request(exception)
render json: { error: exception.message }, status: :bad_request
end
end