package Ġwild . monitor . projects . web Ċ Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation . Controller Ad vice Ċ import Ġorg . springframework . web . bind . annotation . ExceptionHandler Ċ import Ġwild . monitor . projects . No ProjectName Supp lied Exception Ċ import Ġwild . monitor . projects . Project NotFoundException Ċ import Ġwild . monitor . web _ support . ErrorResponse Ċ Ċ @ Controller Ad vice Ċ public Ġclass ĠEndpoint ErrorHandler Ġ{ ĊĠĠĠ Ġ@ ExceptionHandler ( Project NotFoundException :: class ) ĊĠĠĠ Ġfun Ġproject DoesNotExist Exception ( Ġe : ĠProject NotFoundException ): ĠResponseEntity < ErrorResponse > Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResponseEntity . bad Request (). body ( ErrorResponse ( e . message ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġ" Project Ġdoes Ġnot Ġexist .")) ĊĊĠĠĠ Ġ@ ExceptionHandler ( No ProjectName Supp lied Exception :: class ) ĊĠĠĠ Ġfun Ġno ProjectName Supp lied Exception ( e : ĠNo ProjectName Supp lied Exception ): ĠResponseEntity < ErrorResponse > Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResponseEntity . bad Request (). body ( ErrorResponse ( e . message !! , Ġ" Please Ġprovide Ġa Ġunique Ġproject Ġname .")) Ċ } Ċ