      return $borrowersync->update({ 'hashed_pin', _encrypt_pin( $pin ) });
 
  }
-@@ -564,6 +662,23 @@ sub _format_soap_error {
+@@ -564,6 +680,23 @@ sub _format_soap_error {
 
  }
 

+        return ($response, 1);
+    }
+
+    # Something is wrong but we don't know how to handle it, so no point
+    # in trying again.
+    return ($response, 1);
 }

 =head2 NLGetChanged
@@ -426,7 +524,7 @@ sub NLUpdateHashedPIN {
     my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({
         'synctype'       => 'norwegianpatrondb',
         'borrowernumber' => $borrowernumber,

+        # Make sure syncstatus is 'new'
+        $sync->update( { 'syncstatus' => 'new' } );
+        return ($response, 0);
     }
-    return $response;

+    if ($cause =~ /Mangler verdi for sist_endret/) {
+        # Set an arbritary value to missing laststync, it will be corrected on next iteration
+        my $now = `date +"%Y-%m-%dT%T"`;
+        chomp($now);
+        $sync->update( { 'lastsync' => $now } );
+        return ($response, 0);
+    }
+
+    if ($cause =~ /SIST_ENDRET/) {
+        # NL has different timestamp; returnin an error like this:
+        #  endre: Uoverensstemmelse med gjeldende data i basen:
