异常处理
2016-08-28 15:21:24 0 举报
异常处理是编程中的一种重要机制,用于处理程序运行过程中可能出现的错误或异常情况。通过使用异常处理,程序员可以预测并处理潜在的错误,从而避免程序崩溃或产生不可预料的结果。异常处理通常包括try-except语句块,其中try块包含可能引发异常的代码,而except块则定义了当异常发生时要执行的操作。通过捕获和处理异常,程序可以继续执行后续的代码,或者采取适当的措施来恢复错误状态。异常处理还可以帮助程序员识别和修复代码中的错误,提高程序的健壮性和可靠性。总之,异常处理是编写可靠和健壮的程序的重要工具,它可以帮助程序员有效地处理各种错误情况,提高程序的质量和可维护性。
作者其他创作
大纲/内容
implement
UnsupportedOperationAdviceTrait
EmailAlreadyUsedException
StdScalarDeserializer.java
abstract TreeCodec
ProblemHandling
InvalidPasswordException
addressId[地址ID]userNameprovinceName.....consignmentMobile
MappingJackson2HttpMessageConverter
extend
ParameterNamesModule
Address
AbstractJackson2HttpMessageConverter
call
StdDeserializer.java
IOAdviceTrait
SimpleSerializers.java
DatabindContext
BadRequestAlertException
SPRING BOOT ResponseEntity
验证:addressId是否为空
Zalando Problem
ResponseEntity
private final Object status
Throwable
private StackTraceElement [] stackTrace
edit:address
JavaTimeModule
public JavaTimeMoudle()
HttpEntity
private final HttpHeaders headersprivate ffinal T body
ThrowableProblem
interface Serializable
Jdk8Module
CustomParameterizedException
SecurityAdviceTrait
InternalServerErrorException
RuntimeException
SerializerProvider
HttpAdviceTrait
abstract ObjectCodec
new: address
not null
Problem
spring json 处理
RoutingAdviceTrait
Module
public abstract String getModuleName();
GeneralAdviceTrait
Exceptional
interface Deserializers.java
ProblemModule
null
AddressFormData
JavaTimeModule 与 Jackson 联系
ProblemAdviceTrait
@ExceptionHandler
AbstractGenericHttpMessageConverter
interface BeanProperty
参数
AbstractHttpMessageConverter
Exception
EmailNotFoundException
JACKSON 实现流程
Simpleodule.java
protected SimpleDeserializers _deserializers = nullprotected SimpleSerializers _serializers = null
ServerHttpResponse
InstantDeserializer.java
abstract ConcreteBeanPropertyBase.java
abstract Module
AdviceTrait
process
BeanPropertyWriter.java
protected JsonSerializer _serializer
interface Versioned
abstract PropertyWriter.java
AbstractThrowableProblem
SimpleDeserializers.java
ProblemBuilder
public ThrowableProblem build()
系统异常处理
ThrowableAdviceTrait
HttpOutputMessage
OutputStream getBody()
DurationDeserializer.java
JSR310DateTimeDeserializerBase.java
ExceptionTranslator
SimpleModule
HttpMessageConverter
DefaultSerializerProvider
implemnet
...Deserializer.java
ObjectMapper
1 ObjectMapper registerModule(Module module) return ObjectMapper setAttr LinkedHashSet _registerModuleTypes2 WriteValueAsString(Object value) return String
Impl
LoginAlreadyUsedException
JsonDeserializer.java
ValidationAdviceTrait
DefaultProblem
0 条评论
下一页