Skip to content

Commit

Permalink
fix: Use errors instead of info
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudHosamGaber committed May 16, 2024
1 parent b4769f6 commit c726435
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AddFreelancerAchievementResponse Run(AddFreelancerAchievementRequest requ
logger.info("Add Freelancer Achievement");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return AddFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AddFreelancerEducationResponse Run(AddFreelancerEducationRequest request)
logger.info("Add Freelancer Education");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return AddFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AddFreelancerExperienceResponse Run(AddFreelancerExperienceRequest reques
logger.info("Add Freelancer Experience");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return AddFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AddFreelancerLanguageResponse Run(AddFreelancerLanguageRequest request) {
logger.info("Add Freelancer Language");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return AddFreelancerLanguageResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public AddFreelancerSkillResponse Run(AddFreelancerSkillRequest request) {
logger.info("Add Freelancer Skill");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return AddFreelancerSkillResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public GetFreelancerAchievementsResponse Run(GetFreelancerAchievementsRequest re
logger.info("Get Freelancer Achievements");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return GetFreelancerAchievementsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public GetFreelancerEducationsResponse Run(GetFreelancerEducationsRequest reques
logger.info("Get Freelancer Educations");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return GetFreelancerEducationsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public GetFreelancerExperiencesResponse Run(GetFreelancerExperiencesRequest requ
logger.info("Get Freelancer Experiences");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return GetFreelancerExperiencesResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public GetFreelancerLanguagesResponse Run(GetFreelancerLanguagesRequest request)
logger.info("Get Freelancer Languages");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return GetFreelancerLanguagesResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public GetFreelancerSkillsResponse Run(GetFreelancerSkillsRequest request) {
logger.info("Get Freelancer Skills");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return GetFreelancerSkillsResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public RemoveFreelancerAchievementResponse Run(RemoveFreelancerAchievementReques
logger.info("Remove Freelancer Achievement");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return RemoveFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public RemoveFreelancerEducationResponse Run(RemoveFreelancerEducationRequest re
logger.info("Remove Freelancer Education");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return RemoveFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public RemoveFreelancerExperienceResponse Run(RemoveFreelancerExperienceRequest
logger.info("Remove Freelancer Experience");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return RemoveFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public RemoveFreelancerLanguageResponse Run(RemoveFreelancerLanguageRequest requ
logger.info("Remove Freelancer Language");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return RemoveFreelancerLanguageResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public RemoveFreelancerSkillResponse Run(RemoveFreelancerSkillRequest request) {
logger.info("Remove Freelancer Skill");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return RemoveFreelancerSkillResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public UpdateFreelancerAchievementResponse Run(UpdateFreelancerAchievementReques
logger.info("Update Freelancer Achievement");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return UpdateFreelancerAchievementResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public UpdateFreelancerEducationResponse Run(UpdateFreelancerEducationRequest re
logger.info("Update Freelancer Education");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return UpdateFreelancerEducationResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public UpdateFreelancerExperienceResponse Run(UpdateFreelancerExperienceRequest
logger.info("Update Freelancer Experience");
Optional<Freelancer> freelancerOptional = freelancerRepository.findById(request.getUserId());
if (freelancerOptional.isEmpty()) {
logger.info("Freelancer Not Found");
logger.error("Freelancer Not Found");
return UpdateFreelancerExperienceResponse.builder()
.withStatusCode(HttpStatusCode.NOT_FOUND)
.withErrorMessage("Freelancer Doesn't Exist")
Expand Down

0 comments on commit c726435

Please sign in to comment.