interpret_response response

in lib/functions_framework/server.rb [389:409]


      def interpret_response response
        case response
        when ::Array
          response
        when ::Rack::Response
          response.finish
        when ::String
          string_response response, 200
        when ::Hash
          string_response ::JSON.dump(response), 200, content_type: "application/json"
        when ::CloudEvents::CloudEventsError
          cloud_events_error_response response
        when ::StandardError
          message = "#{response.class}: #{response.message}"
          message = [message, *response.backtrace].join "\n\t"
          error_response message
        else
          error_response "Unexpected response type: #{response.class}"
        end
      end