Skip to content

Commit

Permalink
refactor(exception): replace NestedIOException with IOException durin…
Browse files Browse the repository at this point in the history
…g upgrade of spring boot 3.0.x

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-crypto module:
```
> Task :kork-crypto:compileJava FAILED
/kork/kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityIOException.java:20: error: cannot find symbol
import org.springframework.core.NestedIOException;
                               ^
  symbol:   class NestedIOException
  location: package org.springframework.core
/kork/kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityIOException.java:22: error: cannot find symbol
public class NestedSecurityIOException extends NestedIOException {
                                               ^
  symbol: class NestedIOException
2 errors
```
The root cause is the removal of `org.springframework.core.NestedIOException` from springframework 6.0, as mentioned in the below links:
spring-projects/spring-framework#28198
spring-projects/spring-framework#28929
So, replacing `org.springframework.core.NestedIOException` with `java.io.IOException`.
  • Loading branch information
j-sandy committed Dec 19, 2024
1 parent 4eea85e commit f15c324
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.netflix.spinnaker.kork.crypto;

import java.io.IOException;
import java.security.GeneralSecurityException;
import org.springframework.core.NestedIOException;

public class NestedSecurityIOException extends NestedIOException {
public class NestedSecurityIOException extends IOException {
public NestedSecurityIOException(GeneralSecurityException e) {
super(e.getMessage(), e);
}
Expand Down

0 comments on commit f15c324

Please sign in to comment.