GithubHelp home page GithubHelp logo

错误返回机制 about ub-ria HOT 2 CLOSED

fireflyk avatar fireflyk commented on August 18, 2024
错误返回机制

from ub-ria.

Comments (2)

otakustay avatar otakustay commented on August 18, 2024
  1. 这个确实是REST的一般性实践吧,通过HTTP Status Code而非某个字段来表示响应的状态。这在一些文章中也有阐述:http://blog.zenika.com/index.php?post/2011/05/18/Error-handling-with-REST 。与Web Server的冲突应该是运维配置的问题
  2. 如果Http Status Code能代表错误代码,在业务上继续返回一个错误代码字段的作用是……?个人理解这反而会破坏整个响应的语义性并加大解析难度,不过可以讨论

广告管家现有的方案是采用标准的REST化,使用Http Status Code表示响应成功与否及错误类型,响应体只包含数据

from ub-ria.

fireflyk avatar fireflyk commented on August 18, 2024
  1. 运维配置会带来不必要的麻烦
  2. 理解1套errorcode总比理解2套errorcode要简单

from ub-ria.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.